←back to thread

577 points Delgan | 2 comments | | HN request time: 0.517s | source
Show context
827a ◴[] No.44347847[source]
Why would I choose to stash information like this in the git notes, versus just appending it to the commit message itself?
replies(1): >>44347884 #
zygentoma ◴[] No.44347884[source]
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.

replies(1): >>44347903 #
827a ◴[] No.44347903[source]
Ah; so notes don't impact the commit hash? That is a solid reason.
replies(1): >>44348364 #
1. cesarb ◴[] No.44348364[source]
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.
replies(1): >>44348598 #
2. Izkata ◴[] No.44348598[source]
Kind of. The structure is the same and you can check it out if you want, but it's actually a 3rd directory under "refs" - the other two being "heads" (branches) and "tags". That avoids special-casing with trying to hide branches or conflicting with a branch name a user might make.