git/list[1] front-page[2] threads[3] people[4] search[5] about
 

BUG? git rebase -x "git commit --amend …" loses notes

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Aug 5, 2026, 13:13 UTC
Message-ID
<CALnO6CDh6kbL5KH=Nt00ksZCaDbJAnjbepU_tyRTcbGekSyeMg@mail.gmail.com>

Sigh… I haven't minimized a reproduction case here yet, but maybe someone can tell me how I'm holding it wrong.

I have a local branch with notes in refs/notes/benknoble/commits (in particular, the tip commit has a note). I forgot to adjust my author email before creating some of these commits, and I wanted to adjust it to match the mailmap patch I just sent out, so I ran

    git rebase -x "git commit --no-verify --no-edit --amend
--author='$(git config get user.name) <$(git config get user.email)>'"

Upon checking (much) later, I discovered the note was missing! It had not been rewritten. And yet:

    git config get --all --regexp --show-names --show-scope notes | column -t
    global  format.notes      true
    global  notes.rewriteref  refs/notes/commits
    local   core.notesref     refs/notes/benknoble/commits
    local   notes.rewriteref  refs/notes/benknoble/commits
    local   notes.displayref  refs/notes/origin/amlog
So I would have expected the notes to get rewritten?
- Running "git commit … --amend …" (author change and all) rewrites the notes
- Running "git rebase -x echo" rewrites the notes (well, it has
nothing to do right now, so it doesn't modify anything; however, I'm
99.9% convinced that when I did a plain rebase earlier today the notes
were preserved, just like they are all the time)
It's just the combination that loses them :/
-- 
D. Ben Knoble
Next: Phillip Wood
Message 1 of 4 in “BUG? git rebase -x "git commit --amend …" loses notes”
  1. D. Ben KnobleAug 5, 2026
  2. Phillip WoodAug 5, 2026
  3. Phillip WoodAug 5, 2026
  4. D. Ben KnobleAug 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.