Tech News
← Back to articles

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

read original related products more articles

the short of it is: they’re cool for appending notes from automated systems (like ticket or build systems) but not really for having interactive conversations with other developers (at least not yet) – Scott Chacon, GitHub.blog, Aug. 2010

Git notes are almost a secret.

They’re buried by their own distressing usability.

But git notes are continually rediscovered by engineers trying to stash metadata inside git.

Sun, 30 Oct 2022 11:05 @simonw

Git notes are powerful tools. And they could solve so many problems—if only they were better known and easier to use.

🧐 What are git notes? A common use of git notes is tacking metadata onto commits. Once a commit cements itself in git’s history—that’s it. It’s impossible to amend a commit message buried deep in a repo’s log . But git notes enable you to amend new information about old commits in a special namespace. And they’re capable of so much more. Notes stow metadata about anything tracked by git—any object: commits, blobs, and trees. All without futzing with the object itself. You add notes to the latest commit in a repo like this: git notes add -m 'Acked-by: ' And then it shows up in git log : commit 1ef8b30ab7fc218ccc85c9a6411b1d2dd2925a16 Author: Tyler Cipriani Date: Thu Nov 17 16:51:43 2022 -0700 Initial commit Notes: Acked-by:

🥾 Git notes in the wild The git project itself offers an example of git notes in the wild. They link each commit to its discussion on their mailing list. For example: commit 00f09d0e4b1826ee0519ea64e919515032966450 Author: Date: Thu Jan 28 02:05:55 2010 +0100 bash: support 'git notes' and its subcommands ... Notes (amlog): Message-Id: <[email protected]> This commit’s notes point intrepid users to the thread where this patch was discussed. Other folks are using notes for things like: Tracking time spent per commit or branch

Adding review and testing information to git log

And even fully distributed code review

... continue reading