Preferences

Sounds 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 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?


> Are git rebase etc smart enough to also copy over the notes to the new commit...

This is configurable. By default, amend and rebase operations will copy them forward. See git-config(1) under `notes.rewrite`.

chrishill89
By default no copying will be done. While `notes.rewrite.amend` and `notes.rewrite.rebase` are true you also need `notes.rewriteRef` which tells it what notes refs should be rewritten. And it has no value by default. (you can set it to a glob copy over all notes refs)
xg15 OP
Ah, ok. That sounds better. Thanks for the info!

This item has no comments currently.