Re: Transfer notes when rebasing
- From
- Francis Moreau <francis.moro@gmail.com>
- Date
- Sep 4, 2013, 08:03 UTC
- Message-ID
- <CAC9WiBiXsPM7f4ji6TxJMQ3V6w8tG7Hu5inp=cwp1=ZbzWb2gA@mail.gmail.com>
- In-Reply-To
- <20130904075941.GA2582@serenity.lan>
On Wed, Sep 4, 2013 at 9:59 AM, John Keeping <john@keeping.me.uk> wrote:
Show 18 quoted lines
> On Wed, Sep 04, 2013 at 03:53:10AM -0400, Jeff King wrote: >> On Wed, Sep 04, 2013 at 09:51:26AM +0200, Francis Moreau wrote: >> >> > When rebasing a branch which contains commits with notes onto another >> > branch it happens that some commits are already presents in the target >> > branch. >> > >> > In that case git-rebase correctly drops those (already present) >> > commits but it also drops the notes associated with them. >> > >> > Can the notes be transfered somehow in the target branch on the >> > already present commits ? >> >> Yes, see the notes.rewriteRef config option to enable this. > > Does that actually work for this case? It sounds like Francis has the > notes copying correctly when commits are rewritten but the notes are not > copied anywhere if the commit becomes empty.
I don't think so:
$ git config -l ... notes.rewriteref=refs/notes/*
$ git notes show note 1
$ git checkout -b target master~1 Switched to a new branch 'target'
$ git cherry-pick -x master [target 93740ff] commit 6 (cherry picked from commit 5dc90209d7c0195dd9d671c234c49c903b9e1b10) 1 file changed, 1 insertion(+)
$ git rebase target master First, rewinding head to replay your work on top of it...
$ git notes show error: No note found for object 93740ff96b37b2ed7aa0a78861c8beb87fdad474.
Thanks
-- Francis