Git Notes
tylercipriani.com
tylercipriani.com
IMO it's probably the primary reason why libav is practically dead now.
Works great for some types of review system, or for "tagging" things related to deploy. Notes on commits on the master/main branch, which doesn't get rebased? Awesome thing, they work.
But you can't as easily use them on branches: the moment a branch whose commits had notes is rebased, and SHAs change, good-bye notes associated with the "previous" SHAs :/
Is that why people keep building UIs and wrappers for git?
e.g.
defaults=traditional adopts current defaults (that maximise backward compatibility)
defaults=latest adopts latest recommended defaults (better out-of-box user experience, but may break things which depend on the traditional settings)
Then at least there is only one setting to change to get sane defaults.
Maybe even, defaults=VERSION to give you latest defaults as per that version.
> ...
> Then at least there is only one setting to change to get sane defaults.
I suspect that, much like C++, there will be fierce debate over exactly what constitutes sane defaults.
Blobs = any file, keyed by sha1. Also commits (pointer to a tree). Also trees (list of blobs).
Refs (aka branch): points to a specific commit.
I bet notes are just a blob that points to a commit.
That would make them unusable, as you’d have to read all the notes to know if a commit has one.
The notes message is a blob, but the note itself is a tree entry (the name of the entry is the commit being pointed to / annotated).
In the tweet by Simon Willson at the top of the blog post, he uses the word "against":
Started experimenting with "git notes" against a new repo [...]
English is not my native tongue, but I always take the use of this preposition as if to state an adversarial relationship between two things, a relationship of opposition between them.
Therefore, sometimes I find it odd the way it is used in programming-related context.
A few examples of what I mean: - "to program against a standard" instead of "to program based on a standard"
- "to match against a pattern" instead of "to match the pattern onto the thing"
- "to compare against a list" instead of "to compare with items from a list"
- "to file an issue against the repository" instead of "file an issue at the repository"
It is possible (and very likely) that my proposed meanings are grammatically or even semantically wrong,
but I feel that "against" is being correctly used in these examples because I can see a slight opposition between the two things in them,
and I can understand that some people might even find an adversarial relationship there.
However, in the specific case of Simon Willson's tweet, the use of "against" sounds even more off because I fail to see a repository and Git notes as being adversaries or opposite to each other.
So the question is: is only me, as non-native speaker, that finds this usage (not only Willson's, but the examples too) a bit weird, or do native speaker also have similar sentiments?"Against" can also mean something like "adjacent to" or "in contact with", like "let's put the chair against this wall".
As an addendum, my first language is Portuguese, and a direct translation for this word is "contra"¹ which fits all the meanings for "against" listed in Merriam-Webster, except the adjacency one. I've never seen "contra" being used for this meaning in the wild, and I guess this is the reason I feel a bit off about it and never used it myself for that meaning when communicating in English.
- "to push your hand against a wall" - "to press a grinder against some metal" - "to push a mold against the clay"
There's a Newton's third law kind-of thing going on, where two things push against each other, and affect each other.
For "to program against a standard" I am imagining some malleable computer code being pushed against an unyielding form or mold until it conforms to the intended shape (i.e. standard). A similar deal as TDD (test-driven development).
It seems to me that the second and third examples are forms of "compare with and contrast against" the latter being the "relationship of opposition" you mention.
Thinking aloud, "to file an issue against a repository" grammatically resembles "to file a lawsuit against a person" and is similar in that you are registering a complaint against some problem.
> - "to program against a standard" instead of "to program based on a standard"
both idiomatically correct enough
> - "to match against a pattern" instead of "to match the pattern onto the thing"
the second one reads very strangely and I would not be sure what you meant, first is _very_ idiomatically correct
> - "to compare against a list" instead of "to compare with items from a list"
second one is a little strange in the sense of feeling like too many words
> - "to file an issue against the repository" instead of "file an issue at the repository"
second one feels wrong, first is correct but a little weird, "on" is probably what I would write; you can also file "with" if it is a bureaucracy, you file tax forms "with" the irs
> starting to experiment with x against a new repo
Is still weird. It’s not incorrect, but it feels like the author should have used ‘in’ here.
The best way out of this situation could be aliasing the feature to something else with better defaults, with a hope that gets adopted by github/gitlab and the major GUIs
It seems to me to fix so many of the usability issues with Git, and is much more opinionated. I much prefer opinionated tools and frameworks, the fewer (unnecessary and trivial) decisions I have to make in life the better.
But there's https://chiselapp.com/ if you want a hosted solution.
For CI I self host an instance of https://concourse-ci.org/
I'm going to run the ticket number through figlet, then put it in a note for each commit.
Git notes allows comments to be attached to any line for PR.
Issues can just be a well known branch and schema. Issue comments are just git notes.
Ditto for wiki, project management and releases
This way leads to madness. I'm sure it would be possible... but these are not headaches that I want to have.
Not any less than I want them to comment via the web interface.
> Can they make it so that mirrors run out of disk space by adding notes to all the commits or extremely large issues?
Better to solve that than to just not mirror the comments which is what is currently the case. You can always opt your mirror to not fetch notes if that is what you want to do.
(Of course, people have also made a variety of Git-based Web authoring tools spanning from CMSes to wikis, but I can’t say I’ve seen one that really worked out—Git’s capabilities seem too powerful to be tamed in a reasonable Web-based editor. The most elegant way to link from a website to its Git version history that I’ve seen is on Yannik Sander’s blog[1].)
[1] e.g. https://blog.ysndr.de/posts/internals/2021-01-01-flake-ifica...
and thinking: part of the matter from code review outcomes, also some automated check systems have limits, so mutability may be less an issue as first anticipated. git notes might be lightweight enough to not introduce too much bureaucracy.
Unfortunately, we immediately had to rewrite everything using `git-lfs` and `git filter-repo`, so all the associations were lost and we just ended up stuffing everything into the commit message instead where people could actually see it.
[1] https://techbase.kde.org/Projects/MoveToGit/UsingSvn2Git
If you are working on a web app that you can bisect and retest each new version in a few seconds it's an amazing tool.
If you are working on a stack of huge server apps with 1h+ build times, and complicated start up procedures you aren't going to find besect very useful at all.
But even if your build times are that ridiculous, git bisect is still useful because it is not just a constant time improvement - having to do log(n) builds isntead of n is going to be helpful no matter how long each build takes.
If the commits weren't squashed, we could have narrowed down to the individual commit that introduced the (revenue affecting) bug and probably fixed the issue relatively quickly. IIRC, any git-bisect shouldn't take more than ~12ish attempts to find the breaking commit, no matter how many commits there are. At least we knew which PR the issue was affected by, but instead of just hot-fixing what was probably a one-liner, we had to either revert the entire new feature or read through all the changes to find the issue.
There are tons of folks out there for whom git usage is a necessary but background element of some other task they’re doing, and so they know to do one or two add/commit/push style flows. I’ve had many people say to me “every so often I get git errors that I don’t understand so I just delete the whole directory and clone again”
git does need a 'git bug' to track bugs though, as https://github.com/MichaelMure/git-bug does, but I prefer to have it built in git directly if possible.
Either way, maybe it’s time I looked at git’s man page
For private commits I might just store them in the commit message if they are ephemeral. And then remove them before pushing.
The usability is okay for local work. Fiddly for pushing and pulling.
No need to git show the object id of the .txt files in the repo to see the message.
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡾⠋⠉⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⠃⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⡏⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣠⣤⣤⣤⣤⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⡏⠀⠀⠀⠀⢸⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠴⠒⠊⠉⠉⠀⠀⣿⣿⣿⠿⠋⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⢀⡠⠼⠴⠒⠒⠒⠒⠦⠤⠤⣄⣀⠀⢀⣠⠴⠚⠉⠀⠀⠀⠀⠀⠀⠀⠀⣼⠿⠋⠁⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣇⠔⠂⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢨⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠖⠋⠁⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢰⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⠤⠒⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢀⡟⠀⣠⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⢻⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣤⡤⠤⢴
⠀⠀⠀⠀⠀⠀⣸⠁⣾⣿⣀⣽⡆⠀⠀⠀⠀⠀⠀⠀⢠⣾⠉⢿⣦⠀⠀⠀⢸⡀⠀⠀⢀⣠⠤⠔⠒⠋⠉⠉⠀⠀⠀⠀⢀⡞
⠀⠀⠀⠀⠀⢀⡏⠀⠹⠿⠿⠟⠁⠀⠰⠦⠀⠀⠀⠀⠸⣿⣿⣿⡿⠀⠀⠀⢘⡧⠖⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡼⠀
⠀⠀⠀⠀⠀⣼⠦⣄⠀⠀⢠⣀⣀⣴⠟⠶⣄⡀⠀⠀⡀⠀⠉⠁⠀⠀⠀⠀⢸⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠁⠀
⠀⠀⠀⠀⢰⡇⠀⠈⡇⠀⠀⠸⡾⠁⠀⠀⠀⠉⠉⡏⠀⠀⠀⣠⠖⠉⠓⢤⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠃⠀⠀
⠀⠀⠀⠀⠀⢧⣀⡼⠃⠀⠀⠀⢧⠀⠀⠀⠀⠀⢸⠃⠀⠀⠀⣧⠀⠀⠀⣸⢹⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡰⠃⠀⠀⠀
⠀⠀⠀⠀⠀⠈⢧⡀⠀⠀⠀⠀⠘⣆⠀⠀⠀⢠⠏⠀⠀⠀⠀⠈⠳⠤⠖⠃⡟⠀⠀⠀⢾⠛⠛⠛⠛⠛⠛⠛⠛⠁⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠙⣆⠀⠀⠀⠀⠈⠦⣀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⠙⢦⠀⠀⠘⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢠⡇⠙⠦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⠴⠋⠸⡇⠈⢳⡀⠀⢹⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡼⣀⠀⠀⠈⠙⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⣷⠴⠚⠁⠀⣀⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡴⠁⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣆⡴⠚⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣼⢷⡆⠀⣠⡴⠧⣄⣇⠀⠀⠀⠀⠀⠀⠀⢲⠀⡟⠀⠀⠀⠀⠀⠀⠀⢀⡇⣠⣽⢦⣄⢀⣴⣶⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⡿⣼⣽⡞⠁⠀⠀⠀⢹⡀⠀⠀⠀⠀⠀⠀⠈⣷⠃⠀⠀⠀⠀⠀⠀⠀⣼⠉⠁⠀⠀⢠⢟⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣷⠉⠁⢳⠀⠀⠀⠀⠈⣧⠀⠀⠀⠀⠀⠀⠀⣻⠀⠀⠀⠀⠀⠀⠀⣰⠃⠀⠀⠀⠀⠏⠀⠀⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠹⡆⠀⠈⡇⠀⠀⠀⠀⠘⣆⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⣰⠃⠀⠀⠀⠀⠀⠀⠀⣸⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⢳⡀⠀⠙⠀⠀⠀⠀⠀⠘⣆⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⣰⠃⠀⠀⠀⠀⢀⡄⠀⢠⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢳⡀⣰⣀⣀⣀⠀⠀⠀⠘⣦⣀⠀⠀⠀⡇⠀⠀⠀⢀⡴⠃⠀⠀⠀⠀⠀⢸⡇⢠⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠉⠉⠀⠀⠈⠉⠉⠉⠙⠻⠿⠾⠾⠻⠓⢦⠦⡶⡶⠿⠛⠛⠓⠒⠒⠚⠛⠛⠁⠀⠀⠀⠀⠀
(not my art, taken from https://emojicombos.com/pikachu-ascii-art)The real answer is that the notes are not part of the commit hash and are mutable, which means that you can use them for temporary information and/or to add notes retroactively.
After reading the whole thing I was still not really clear why they not great for conversations with other developers.
You could probably even make some automated system that sync'd GitHub commit comments with the repo git notes.
You'd just have to settle on a fixed format. .
> 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.
git checkout v0123
git difftool v0123 v0158
are quite useful. Didn't know it had a performance impact.
Is that the same thing, or perhaps implemented by using Git Notes?
IntelliJ products try to provide a common interface and common naming for all "VCS" operations, whether it's Git/Mercurial/etc. In practice this obscures the actual Git operations though and requires learning yet another set of "abstract" IntelliJ-specific names for the same thing. I wish they'd stop doing that, it's really confusing and inaccurate.
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 log1.
But git notes enable you to amend new information about old commits in a special namespace. And they’re capable of so much more.
The article has an answer to this in the second paragraph.
Since git notes are tied to a particular SHA they don't get included.
You can configure git to do it though. As mentioned else where in the comments, here's a good stackoverflow answer explaining how:
https://stackoverflow.com/questions/14585613/is-there-a-way-...
let me be the opposing voice. this is a pure nerd add-on with zero value for regular users. i went through all the usage examples. even those from this thread. there is zero added value. you can link, point, store, etc. to your commit and get the same thing.