Notes stow metadata about anything tracked by git—any object: commits, blobs, and trees.
The git project itself offers an example of git notes in the wild. They link each commit to its discussion on their mailing list.
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
Review notes are used by Gerrit (Wikimedia) and many google projects. For example:
Author: User <email@example.com>
Date: Sun Mar 27 18:10:51 2022 +0200
Change the thing
Verified+1: SonarQube Bot
Code-Review+2: Reviewer Human <firstname.lastname@example.org>
Submitted-at: Tue, 14 Jun 2022 21:59:58 +0000
There is also an extension from Google to git notes dedicated to code review: https://github.com/google/git-appraise. Request review, comment and review and merge are included.
Its authors have declared it a “fully distributed code review”—independent of GitHub, GitLab, or any other code forge.
Git notes are however a pain to use. Mhmhmhm #idea #project on top of the git note commands?
For commits, you can make viewing and adding notes easier using fancy options in your gitconfig3. But for storing notes about blobs or trees? Forget it. You’d need to be comfortable rooting around in git’s plumbing first.
Much of the value of git repos ends up locked into forges, like GitHub. Git notes are a path toward an alternative and it could make it possible to distribute the history of an entire project.