frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Git Notes: Git's coolest, most unloved­ feature (2022)

https://tylercipriani.com/blog/2022/11/19/git-notes-gits-coolest-most-unloved-feature/
184•Delgan•8h ago

Comments

akoboldfrying•7h ago
I've been using git for probably 10 years and I didn't know git notes existed. Cool!

> Here is a plea for all forges: make code review metadata available offline, inside git.

I think this will fall on deaf ears as far as commercial forges like GitHub go, since as you yourself observe:

> But much of the value of git repos ends up locked into forges, like GitHub.

For-profit enterprises are not generally excited about commoditising their own value-add. This is not a jab at GitHub -- I think GitHub do everything right (offer a great service, a very generous free tier, and make it possible to extract all your data via API if you want to shift providers). It's just the nature of any commercial operation.

esafak•3h ago
You have to start a new service that offers that feature as one of its differentiators, then the competitors might add it (back) to catch up.
xeonmc•2h ago
any reason why Forgejo/Codeberg couldn't/wouldn't adopt this?
bicolao•2h ago
The only git-notes related issue I found is https://codeberg.org/forgejo/forgejo/issues/6385. So, probably because nobody has raised it.
saghm•1h ago
Seems like a chicken-and-egg problem. Not enough people know about them because they aren't supported by most providers, and because people don't know about them, there's no pressure for providers to add support for them.
marcodiego•3h ago
I bet it already exists, but what about an issue tracker in plain text maintained by git itself?
shawnz•3h ago
See this recent discussion:

https://news.ycombinator.com/item?id=43971620

And less recently:

https://news.ycombinator.com/item?id=20318947

https://news.ycombinator.com/item?id=13732598

lelanthran•2h ago
> I bet it already exists, but what about an issue tracker in plain text maintained by git itself?

I have an issue tracker file that can be added to a project. While it's technically plain text, the interface for the file ensures that a format is used, and the format ensures that changes reflect only a single ticket.

Just as long as no one edits the file using a different program, it will work just fine.

Don't think anyone uses it, though.

https://github.com/lelanthran/rotsit

righthand•2h ago
Also checkout fossil-scm.org
kccqzy•3h ago
Git notes are only cool if you frequently add text to a commit after the commit has happened and visible to others.

The Acked-By and mailing list discussion link examples don't seem to be good examples. Both of these are likely already known when the commit is made. And git commit message basically can have an unlimited length, so you could very well copy all the discussions about the commit that happened on a forge into the commit message itself.

One use case I think might be a better example is to add a git note to a commit that has later been reverted.

0x696C6961•2h ago
Discussion can keep happening after the commit is created.
Zambyte•2h ago
> The Acked-By and mailing list discussion link examples don't seem to be good examples. Both of these are likely already known when the commit is made.

Discussion regarding a commit (is: review) and acknowledgment of a commit cannot happen before the commit has been made.

> One use case I think might be a better example is to add a git note to a commit that has later been reverted.

Commit messages are better for this use case. When you got blame a file, it shows the latest changes for that file. If a commit reverts changes from another commit, the newer commit that reverts the older commit will show up in the blame.

saghm•1h ago
> Discussion regarding a commit (is: review) and acknowledgment of a commit cannot happen before the commit has been made.

It can't happen before the commit on a feature branch, but it can happen before merging the commit back to the main development branch. Given that a rebase or merge commit is already frequently necessary to integrate changes from a feature branch after review is finished, I don't see why this type of info couldn't be added (or even required to exist) before merging.

Pxtl•1h ago
The history-destroying problems of rebasing are a rant on their own.
Zambyte•33m ago
That's a UI problem with git making it hard to find hidden commits (pre-rebase). The commits aren't destroyed, they are hidden. The Jujutsu CLI is nice because it fixes this UI problem.
olejorgenb•3h ago
What happens of you rebase a branch containing commits with notes attached?
jwilk•3h ago
Notes are copied to from the original to the rewritten commit by default. See https://git-scm.com/docs/git-notes#Documentation/git-notes.t... for details.

But I have this in my IRC logs:

  < _jwilk> TIL git-notes rewriting doesn't work properly when doing amend within rebase. :/
paffdragon•1h ago
Check the notes.rewrite config options in https://git-scm.com/docs/git-notes#Documentation/git-notes.t... Also notes.rewriteRef. You can use these to configure git to carry your notes across amend/rebase.
b0a04gl•3h ago
i use git notes pretty heavily in my current role. started as an experiment to keep track of internal code reviews without flooding the commit message or making PRs for everything. i tag every commit with context what tickets it maps to, infra constraints, links to incident threads if it's a fix. all lives in the repo. this avoids the need to grep slack or jira just to know why a line changed. nce you start using it at scale, you realise how little you need the platform UI at all. we keep talking about reproducibility in builds, but never in intent. maybe this is where that starts
smallpipe•59m ago
Shouldn’t that be the commit message ? Or is the goal to also link forward in time, such as “we realised this commit introduced bug #123” ?
b0a04gl•39m ago
haha wait do you actually read long commit messages all the way through? like line-by-line, imo commit msg = tweet, git note = blog post.
smallpipe•27m ago
In my line of work a bug could cost multiple millions. I do read them. I write long ones. I would love if my colleagues started writing longer ones too.
mojifwisi•26m ago
That seems more complicated than just adding the info in the commit message. It's not like Git doesn't have flags for trimming commit messages when reading them (--oneline).
noelwelsh•3h ago
This is a UI problem, not a lack-of-knowledge problem. If Github's UI surfaced notes they would instantly get much more usage.
stephenlf•2h ago
Yeah I wish GitHub supported these
oftenwrong•3h ago
Another little-known feature is git trailers:

https://alchemists.io/articles/git_trailers

These are key-value structures data that can be included on a commit when it is created. These are used by some systems for attaching metadata. For example, Gerrit uses this for attaching its Change-Id.

oftenwrong•2h ago
One more similar feature from a different system: PostgreSQL COMMENT

https://www.postgresql.org/docs/17/sql-comment.html

This allows you to attach text to various database objects in PostgreSQL.

I wish PostgreSQL had a feature that was more like structured key-value database object metadata that could be edited.

stephenlf•2h ago
I love PostgreSQL COMMENT. I built a prototype app for a buddy with Supabase and added a COMMENT to every table.
codesnik•1h ago
with supabase it is almost essential. But adding comments with migrations is somewhat tedious, unless you're writing actual sql. Like, you know, with supabase.
Pxtl•1h ago
MS SQL has a similar feature called Extended Properties but the API is quite tedious.
EPWN3D•2h ago
Yeah I love trailers. I remember trying to use notes for certain things, and they were just kind of a pain (though I cannot remember exactly what roadblocks I hit). Trailers met my needs nicely.
stephenlf•1h ago
This is fantastic. This could really beef up CI with ticket numbers and stuff.
mdaniel•1h ago
I recently learned that GitHub uses it for an alternative to including [skip ci] for what I presume is easier removal by downstream consumers of the commit message https://docs.github.com/en/actions/managing-workflow-runs-an...

I don't know why they mandate it to be the last trailer unless it's for regex reasons

adregan•1h ago
While I mostly try to go with the flow, I do get frustrated that there are more natural places to integrate with a issue tracking system like trailers, but they are so far off issue trackers’ happy path that it’s not worth it.

I think the problem is exacerbated by the fact that issue trackers follow fashion; and it’s more common that you are using the flavor of the week; and that flavor isn’t close to feature complete; and new features get added at a glacial pace.

I suppose this is a long winded way of stating how annoyed I am with branch names derived from linear ticket’s titles for tracking purposes, and I wish I could use some other form of metadata to associate commits with an issue, so that I could have more meaningful PR titles (enforced that I must use the linear branch name as the title).

Though I’ll admit that it’s an issue of a size that’s more appropriate to gripe about on the internet than try to change.

imiric•33m ago
Interesting, I wasn't familiar with this feature.

I'm a big fan of conventional commits, and trailers seem like a better way of adding such metadata.

Is adding them manually to the commit message functionally equivalent to using the `--trailer` flag?

cmrdporcupine•27m ago
Side note: I really miss Gerritt from my time working at GOOG, but man is its deployment story kinda crap in the 2020s. I tried to run an instance locally and was hoping to integrate it with my github hosted repo ended up just frustrated.

Is there anything equivalent -- that handles tracking changes over commits etc better than GH -- that is more actively developed and friendly for integration with GH? I hate GH's code review tools with the heat of 10,000 suns.

_flux•17m ago
I used git notes for marking which of my commits in my branch I had run the unit tests for (and thus my script would skip those). This was useful when working with open source upstream where you want the massage the branch to perfection with git rebase -i.

It seems git trailers would now be the better place to put that information.

Regarding change ids: I wish git itself had those, as then also the tooling would understand them. Identifying commits by their commit messages is fragile, in particular when you may update those for an MR. While commit id truly identifies the commit in a unique way, it is not a useful identifier when the same changes could be moved on top of some other commit.

edit: Oh it looks like they are actually part of the commit, whereas notes aren't, so it wouldn't be a good replacement for my use.

homebrewer•2h ago
Also supported by Forgejo since version 10 (released in January of this year):

https://forgejo.org/2025-01-release-v10-0/#new-features

https://codeberg.org/forgejo/forgejo/pulls/4753

Tmpod•2h ago
That's neat, ty for sharing!
Shank•2h ago
Why did GitHub remove support for them, and how do we get this decision reversed?
fmbb•1h ago
I think the answer is in the link.

Making git notes more usable would make it easier to migrate from GitHub. It would make you less locked in.

remram•1h ago
In practice I get a lot of value out of referencing commit hashes. If I fix a problem I introduced in a previous commit (for example, commit bumped version, and I forgot to bump it somewhere), my fix will say "amends ab12cd34".

That way when I need to cherry-pick that commit, or do something similar (bump again), I can search for the hash of the commit I'm looking at to find what might be missing.

UI is worse than git-notes but no need for additional setup to sync them.

codesnik•1h ago
you kinda doing by hand what git commit --fixup could do for you, and what git rebase -i could pick up automatically.
legends2k•1h ago
I discovered notes from the man pages around 2020 but didn't use them as it was primarily a local repo feature. By default they don't get pushed or fetched. If course, one can configure it such that it's pushed and fetched, but that's a team decision and mine didn't vote for it.
827a•1h ago
Why would I choose to stash information like this in the git notes, versus just appending it to the commit message itself?
zygentoma•1h ago
Because you would not want to write the whole git history starting from the commit you want to stash this info one everytime you want to stash additional info …

Appending information to the commit itself creates a new commit and all the commits that are based on the commit will also have to change consequently.

827a•1h ago
Ah; so notes don't impact the commit hash? That is a solid reason.
cesarb•28m ago
Yeah, git notes are AFAIK stashed into their own hidden branch, referencing the original commit by its hash. That is, the git note points to the commit, not the opposite.
hungryhobbit•1h ago
Coolest? It's just extra comments...
paffdragon•1h ago
I wrote a little tool for versioning based on conventional commits that uses git note for a version override. In case you want to force a specific version instead of the one autodetected, you can add a git note with the version you want.

This was useful when migrating a piece of functionality into its own repo and you want to preserve history. Adding these forced version tags into commits would be quite messy in the new repo where you switch to a new versioning scheme.

pettereriksson•1h ago
I think it would be interesting to add the prompt (or a summary of the prompt) as a note for each commit. This would allow the LLM to later reason about each line of code by going back and checking the notes to mine for requirements, and take those into account when changing the code again.
lozenge•32m ago
Or just put it in the commit message, after all, it is the human's description of what the commit is supposed to do
lucasoshiro•58m ago
There are many "Git's coolest, most unloved feature", e.g.: bisect, pickaxe, reflog, range-diff, archive, annotated tags, etc. Sadly they are often forgotten as many people thing of Git only as a glorified Google Drive...
knallfrosch•35m ago
Git notes is redundant since you need a higher-level project management tool to track features anyway. Roadmaps, feature hierarchy and non-technical details. Think of any big tracker or Jira.

I think that's fine. Unix philosophy is to focus on one thing and do that well.

pydry•23m ago
In many cases this is because those features arent actually that useful and they are frivolities surrounding a workhorse.
nop17•50m ago
If note just for the last commit, would it easier just amend the last commit message to include any note? Don't need remember another command option.
cesarb•32m ago
Git notes were used at the LibreOffice project to track, for each commit to the Apache OpenOffice repository (which they mirrored as a branch on LibreOffice's git repository), whether that commit was not relevant (for instance, changes to the build system which LibreOffice had long replaced with a better one), duplicated an already existing change on LibreOffice (often from many years earlier), or, the least common case, that it was accepted into LibreOffice (and which commit did the cherry-pick). You can still see it for itself at https://cgit.freedesktop.org/libreoffice/core/log/?h=aoo/tru... (that git front-end still displays notes).

(They stopped tracking these changes a few years ago, probably because the pace of changes to Apache OpenOffice slowed down to a trickle, and there's no longer much to be gained by cherry-picking these few changes.)

Mechanical Watch: Exploded View

https://fellerts.no/projects/epoch.html
229•fellerts•2h ago•32 comments

Git Notes: Git's coolest, most unloved­ feature (2022)

https://tylercipriani.com/blog/2022/11/19/git-notes-gits-coolest-most-unloved-feature/
188•Delgan•8h ago•57 comments

LibRedirect – Redirects popular sites to alternative privacy-friendly frontends

https://libredirect.github.io
284•riffraff•11h ago•74 comments

The Cultural Decline of Literary Fiction

https://oyyy.substack.com/p/the-cultural-decline-of-literary
15•libraryofbabel•1h ago•17 comments

TPU Deep Dive

https://henryhmko.github.io/posts/tpu/tpu.html
300•transpute•14h ago•51 comments

How to negotiate your salary package

https://www.complexsystemspodcast.com/episodes/how-to-negotiate-your-salary-package/
15•surprisetalk•3d ago•2 comments

Allocators Are Monkeys with Typewriters

https://tgmatos.github.io/allocators-are-for-monkeys-with-typewriters/
20•gilgamesh3•3d ago•8 comments

Low-Temperature Additive Manufacturing of Glass

https://www.ll.mit.edu/research-and-development/advanced-technology/microsystems-prototyping-foundry/low-temperature
61•LorenDB•4d ago•13 comments

Sound As Pure Form: Music Language Inspired by Supercollider, APL, and Forth

https://github.com/lfnoise/sapf
154•mindcrime•15h ago•31 comments

Mbake – A Makefile formatter and linter, that only took 50 years

https://github.com/EbodShojaei/bake
169•rainmans•2d ago•76 comments

P-Hacking in Startups

https://briefer.cloud/blog/posts/p-hacking/
243•thaisstein•4d ago•116 comments

Harry Brearley, the creator of stainless steel (2016)

https://nautil.us/the-father-of-modern-metal-235939/
57•bookofjoe•4h ago•16 comments

Largest Wildlife Bridge Spanning 10 Lanes of CA 101 Is Nearly Complete

https://www.thedrive.com/news/worlds-largest-wildlife-bridge-spanning-10-lanes-of-101-freeway-is-nearly-complete
85•PaulHoule•3d ago•36 comments

Show HN: I'm a doctor and built a responsive breathing app for anxiety and sleep

https://apps.apple.com/us/app/lungy-breathing-exercises/id1545223887
38•lukko•7h ago•14 comments

How fast are Linux pipes anyway?

https://mazzo.li/posts/fast-pipes.html
54•keepamovin•9h ago•4 comments

LaborBerlin: State-of-the-Art 16mm Projector

https://www.filmlabs.org/wiki/en/meetings_projects/spectral/laborberlin16mmprojector/start
193•audionerd•21h ago•34 comments

Denmark's Archaeology Experiment Is Paying Off in Gold and Knowledge

https://www.scientificamerican.com/article/denmark-let-amateurs-dig-for-treasure-and-it-paid-off/
181•sohkamyung•4d ago•94 comments

Airpass – Easily overcome WiFi time limits

https://airpass.tiagoalves.me/
347•herbertl•4d ago•235 comments

Type Inference Zoo

https://zoo.cuichen.cc/
138•mpweiher•4d ago•5 comments

uBlock Origin Lite Beta for Safari iOS

https://testflight.apple.com/join/JjTcThrV
336•Squarex•1d ago•95 comments

The Great Egg Heist

https://www.washingtonpost.com/investigations/interactive/2025/eggs-prices-gouging-cal-maine-investigation/
18•tintinnabula•3d ago•8 comments

Load Test GlassFlow for ClickHouse: Real-Time Dedup at Scale

https://www.glassflow.dev/blog/load-test-glass-flow-for-click-house-real-time-deduplication-at-scale
10•super_ar•3d ago•3 comments

Phoenix.new – Remote AI Runtime for Phoenix

https://fly.io/blog/phoenix-new-the-remote-ai-runtime/
583•wut42•2d ago•253 comments

Requiem for a Solar Plant

https://7goldfish.com/articles/Requiem_for_a_solar_plant.php
101•akkartik•18h ago•88 comments

U.S. bombs Iranian nuclear sites

https://www.bbc.co.uk/news/live/ckg3rzj8emjt
1042•mattcollins•17h ago•3052 comments

When Humans Learned to Live Everywhere

https://www.nytimes.com/2025/06/18/science/ancient-human-adaptation-environments.html
34•pepys•3d ago•12 comments

Delta Chat is a decentralized and secure messenger app

https://delta.chat/en/
279•Bluestein•1d ago•170 comments

Using Microsoft's New CLI Text Editor on Ubuntu

https://www.omgubuntu.co.uk/2025/06/microsoft-edit-text-editor-ubuntu
271•jandeboevrie•4d ago•282 comments

Scaling our observability platform by embracing wide events and replacing OTel

https://clickhouse.com/blog/scaling-observability-beyond-100pb-wide-events-replacing-otel
193•valyala•1d ago•95 comments

Unexpected security footguns in Go's parsers

https://blog.trailofbits.com/2025/06/17/unexpected-security-footguns-in-gos-parsers/
211•ingve•4d ago•119 comments