Git Notes: Git's coolest, most unloved feature (2022)
81–90 of 147 posts
Re: Git Notes: Git's coolest, most unloved feature (2022)
#82There 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...
In many cases this is because those features arent actually that useful and they are frivolities surrounding a workhorse.
It’s hard to explain to them that things like “mis en place” aren’t OCD but table stakes for sophisticated activities.
Re: Git Notes: Git's coolest, most unloved feature (2022)
#83Earlier quoted context omitted.
The history-destroying problems of rebasing are a rant on their own.
Can you say more? I use rebase to avoid history destruction/obscuration. Do you mean squash? If so then I agree.
Re: Git Notes: Git's coolest, most unloved feature (2022)
#84Re: Git Notes: Git's coolest, most unloved feature (2022)
#85https://gitlab.com/gitlab-org/gitlab/-/issues/15029
You have to log in to read it unfortunately, but any gitlab.com account should work.
Re: Git Notes: Git's coolest, most unloved feature (2022)
#86There 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...
In many cases this is because those features arent actually that useful and they are frivolities surrounding a workhorse.
So, yet I understand that some tools do too much, I don't think that this is the case here.
Re: Git Notes: Git's coolest, most unloved feature (2022)
#87There 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...
Ha, I expected to know the features you were going to list, but got surprise attacked by pickaxe. What the hell? I guess I shouldn’t be so confident
Re: Git Notes: Git's coolest, most unloved feature (2022)
#88What happens on interactive rebases, e.g. if I squash multiple commits into a single one?
I see the same problem with attaching notes to blobs and trees: It's not doing what you might think it does: It feels like it would attach metadata to a file or directory in the repo, but it really attaches the metadata to some specific content:
E.g. if you have a blob that encodes the string "Hello world!" and attach the note to it, would git associate that note with all files that have that content?
Also, if you change one file to "Hello, world!", would it lose the notes?
Re: Git Notes: Git's coolest, most unloved feature (2022)
#89What happens of you rebase a branch containing commits with notes attached?
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: TIL git-notes rewriting doesn't work properly when doing amend within rebase. :/
One thing that would be really useful though - if you could somehow use git notes to tell Git not to download some blobs by default that would be great. It would solve the "someone added 100 MB of binary files to this project 5 years ago and then deleted them" problem.
That would be too useful though so I wont hold by breath.
Re: Git Notes: Git's coolest, most unloved feature (2022)
#90Sounds really cool, but how do notes play together with the "history rewriting" features (amend, rebase, etc) where you effectively replace a commit with a modified copy? It sounds as if the notes are attached to a specific commit (or tree or blob) ID. Are git rebase etc smart enough to also copy over the notes to the new commit, or will they just vanish? What happens on interactive rebases, e.g. if I squash multiple…
This is configurable. By default, amend and rebase operations will copy them forward. See git-config(1) under `notes.rewrite`.