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

Re: Transfer notes when rebasing

From
FMFrancis 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
Previous: John KeepingNext: Jeff King
Message 4 of 7 in “Transfer notes when rebasing”
  1. Francis MoreauSep 4, 2013
  2. Jeff KingSep 4, 2013
  3. John KeepingSep 4, 2013
  4. Francis MoreauSep 4, 2013
  5. Jeff KingSep 4, 2013
  6. Francis MoreauSep 4, 2013
  7. Jeff KingSep 4, 2013

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.