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

[Bug?] git notes are not copied during rebase

From
NKNorbert Kiesel <nkiesel@gmail.com>
Date
Nov 16, 2016, 23:38 UTC
Message-ID
<CAM+g_NvFhyReNREpTYKbXKm=8QmSH1tnrTCyFm9HusOnfAbCCA@mail.gmail.com>
Hi,

I am currently a heavy user of rebasing and noticed that my notes don't get correctly applied, even if notes.rewrite.rebase is set explicitly to true (though manual says that is the default).

Below is a use case that shows that a commit on a branch got rebased, but the note was not copied to the new commit.

% mkdir notes
% cd notes
% git init
Initialized empty Git repository in /tmp/notes/.git/
% date
% git add a
% git commit -m c1
[master (root-commit) 2e24a91] c1
 1 file changed, 1 insertion(+)
 create mode 100644 a
% git checkout -b mybranch
Switched to a new branch 'mybranch'
% date
% git add b
% git commit -m c2
[mybranch 5ef9954] c2
 1 file changed, 1 insertion(+)
 create mode 100644 b
% git notes add -m note1
% git log
commit 5ef9954 (HEAD -> mybranch)
Author: Norbert Kiesel <nkiesel@metricstream.com>
Date:   Mon Nov 14 15:48:00 2016 -0800
    c2
Notes:
    note1
commit 2e24a91 (master)
Author: Norbert Kiesel <nkiesel@metricstream.com>
Date:   Mon Nov 14 15:48:00 2016 -0800
    c1
% git notes
c39895a0948c17df2028f07c3ec0993a532edabf
5ef9954dbadddfccefe95277be5e7a995335124b
% git checkout master
Switched to branch 'master'
% date
% git commit -a -m c3
[master 1368832] c3
 1 file changed, 1 insertion(+)
% git rebase master mybranch
First, rewinding head to replay your work on top of it...
Applying: c2
% git log
commit 8921cb7 (HEAD -> mybranch)
Author: Norbert Kiesel <nkiesel@metricstream.com>
Date:   Mon Nov 14 15:48:00 2016 -0800
    c2
commit 1368832 (master)
Author: Norbert Kiesel <nkiesel@metricstream.com>
Date:   Mon Nov 14 15:48:00 2016 -0800
    c3
commit 2e24a91
Author: Norbert Kiesel <nkiesel@metricstream.com>
Date:   Mon Nov 14 15:48:00 2016 -0800
    c1
% git notes
c39895a0948c17df2028f07c3ec0993a532edabf
5ef9954dbadddfccefe95277be5e7a995335124b
Next: SZEDER Gábor
Message 1 of 2 in “[Bug?] git notes are not copied during rebase”
  1. Norbert KieselNov 16, 2016
  2. SZEDER GáborNov 17, 2016

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.