{"thread":{"id":"44502","subject":"[Bug?] git notes are not copied during rebase","startedAt":"2016-11-16T23:38:47Z","lastAt":"2016-11-17T10:47:43Z","messageCount":2,"participants":["Norbert Kiesel","SZEDER Gábor"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"306087","messageId":"CAM+g_NvFhyReNREpTYKbXKm=8QmSH1tnrTCyFm9HusOnfAbCCA@mail.gmail.com","threadId":"44502","inReplyTo":null,"subject":"[Bug?] git notes are not copied during rebase","fromName":"Norbert Kiesel","fromEmail":"nkiesel@gmail.com","sentAt":"2016-11-16T23:38:40Z","receivedAt":"2016-11-16T23:38:47Z","isPatch":false,"sender":{"key":"nkiesel@gmail.com","avatar":null},"body":"Hi,\n\nI am currently a heavy user of rebasing and noticed that my notes\ndon't get correctly applied, even if notes.rewrite.rebase is set\nexplicitly to true (though manual says that is the default).\n\nBelow is a use case that shows that a commit on a branch got rebased,\nbut the note was not copied to the new commit.\n\n% mkdir notes\n% cd notes\n% git init\nInitialized empty Git repository in /tmp/notes/.git/\n% date\n% git add a\n% git commit -m c1\n[master (root-commit) 2e24a91] c1\n 1 file changed, 1 insertion(+)\n create mode 100644 a\n% git checkout -b mybranch\nSwitched to a new branch 'mybranch'\n% date\n% git add b\n% git commit -m c2\n[mybranch 5ef9954] c2\n 1 file changed, 1 insertion(+)\n create mode 100644 b\n% git notes add -m note1\n% git log\ncommit 5ef9954 (HEAD -> mybranch)\nAuthor: Norbert Kiesel <nkiesel@metricstream.com>\nDate:   Mon Nov 14 15:48:00 2016 -0800\n\n    c2\n\nNotes:\n    note1\n\ncommit 2e24a91 (master)\nAuthor: Norbert Kiesel <nkiesel@metricstream.com>\nDate:   Mon Nov 14 15:48:00 2016 -0800\n\n    c1\n% git notes\nc39895a0948c17df2028f07c3ec0993a532edabf\n5ef9954dbadddfccefe95277be5e7a995335124b\n% git checkout master\nSwitched to branch 'master'\n% date\n% git commit -a -m c3\n[master 1368832] c3\n 1 file changed, 1 insertion(+)\n% git rebase master mybranch\nFirst, rewinding head to replay your work on top of it...\nApplying: c2\n% git log\ncommit 8921cb7 (HEAD -> mybranch)\nAuthor: Norbert Kiesel <nkiesel@metricstream.com>\nDate:   Mon Nov 14 15:48:00 2016 -0800\n\n    c2\n\ncommit 1368832 (master)\nAuthor: Norbert Kiesel <nkiesel@metricstream.com>\nDate:   Mon Nov 14 15:48:00 2016 -0800\n\n    c3\n\ncommit 2e24a91\nAuthor: Norbert Kiesel <nkiesel@metricstream.com>\nDate:   Mon Nov 14 15:48:00 2016 -0800\n\n    c1\n% git notes\nc39895a0948c17df2028f07c3ec0993a532edabf\n5ef9954dbadddfccefe95277be5e7a995335124b\n"},{"id":"306103","messageId":"20161117103043.4835-1-szeder@ira.uka.de","threadId":"44502","inReplyTo":"CAM+g_NvFhyReNREpTYKbXKm=8QmSH1tnrTCyFm9HusOnfAbCCA@mail.gmail.com","subject":"Re: [Bug?] git notes are not copied during rebase","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2016-11-17T10:30:43Z","receivedAt":"2016-11-17T10:47:43Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"> I am currently a heavy user of rebasing and noticed that my notes\n> don't get correctly applied, even if notes.rewrite.rebase is set\n> explicitly to true (though manual says that is the default).\n\nSetting 'notes.rewrite.rebase' is, as you mentioned, not necessary,\nbut not sufficient either.  See here, especially the second paragraph:\n\n   notes.rewriteRef\n       When copying notes during a rewrite, specifies the (fully\n       qualified) ref whose notes should be copied. May be a glob, in\n       which case notes in all matching refs will be copied. You may also\n       specify this configuration several times.\n\n       Does not have a default value; you must configure this variable to\n       enable note rewriting.\n\n       Can be overridden with the GIT_NOTES_REWRITE_REF environment\n       variable.\n\nGábor\n\n"}]}