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

Re: notes.rewriteRef doesn't apply to rebases that skip the commit

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 7, 2014, 21:33 UTC
Message-ID
<xmqqzjjwlt9p.fsf@gitster.dls.corp.google.com>
In-Reply-To
<99F95780-059D-4F62-A851-C43729BB9893@sb.org>
Kevin Ballard <kevin@sb.org> writes:
Show 6 quoted lines
> I’ve started using notes recently, and I have notes.rewriteRef set so that
> when I rebase, my notes will be kept. Unfortunately, it turns out that if a
> rebase deletes my local commit because it already exists in upstream, it
> doesn’t copy the note to the upstream commit. It seems perfectly reasonable to
> me to expect the note to be copied to the upstream commit, as it represents
> the same change.

That would cut both ways, depending on the use case. I suspect that those who use notes as remainder of what are still to be sent out would appreciate the current behaviour.

> One complication I can see is when my local commit is deleted not because it
> exists upstream, but because it ends up being an empty commit due to the
> changes existing across multiple upstream commits. In this case I see no
> alternative but to have the note disappear. But I think that's acceptable.
Oh, no question about that.
Show 6 quoted lines
> Another potential issues is if the commit exists upstream, but the surrounding
> context has changed enough that it contains a different patch-id. In this
> case, I would want Git to take the extra effort to correlate the upstream
> commit with my local one (it has the same message, modulo any Signed-Off-By
> lines, the same authorship info, and all the - and + lines in the diff are
> identical).

That would be an orthogonal improvement, I would think. Such a smarter "patch-id may mistake it, but it is a moral equivalent" detection would not only be useful for copying notes, but also for skipping the commit from getting replayed in the first place, no?

Show 5 quoted lines
> On a semi-related note, I don't see why Git should be warning about
> notes.displayRef evaluating to a reference that doesn't exist. It doesn't
> exist because I haven't created any notes for that ref in this repository yet.
> But that doesn't mean I won't be creating them eventually, and when I do I
> want them to be displayed.

That also cuts both ways. I think a warning is primarily to let those who mistyped the refname take notice.

Previous: Kevin BallardNext: Kevin Ballard
Message 2 of 3 in “notes.rewriteRef doesn't apply to rebases that skip the commit”
  1. Kevin BallardApr 7, 2014
  2. Junio C HamanoApr 7, 2014
  3. Kevin BallardApr 7, 2014

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.