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

Re: Should notes handle replace commits?

From
Mike Hommey <mh@glandium.org>
Date
Jan 8, 2016, 21:49 UTC
Message-ID
<20160108214939.GA22801@glandium.org>
In-Reply-To
<xmqqh9in25py.fsf@gitster.mtv.corp.google.com>
On Fri, Jan 08, 2016 at 12:09:45PM -0800, Junio C Hamano wrote:
Show 6 quoted lines
> > So the question is, is this the behavior this should have?
> 
> The behaviour is a natural consequence of what graft and replace are
> about (i.e. "telling Git what the parents of a commit are" vs
> "telling Git what the contents of a commit are"), so the answer to
> the "should" question is a resounding "yes".

It's not only about contents, except for a very broad definition of contents that includes ancestry. From my POV, replace is more about "telling Git that this commit (and its parents) is really that one (and its parents)".

Anyways, the dummy example is using different commit messages, and notes everywhere, to make what happens to commits and notes obvious. In the real world, "first" would be "real third", so the commit messages would be as expected in all cases. The question is whether users expect the note of the non-replaced commit to show up. Would they expect no note at all in the case there is a note on the replacee, but not on the replaced? Maybe the right thing to do would be for *both* notes to be concatenated? I don't know.

Mike
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 12 in “Should notes handle replace commits?”
  1. Mike HommeyJan 8, 2016
  2. Junio C HamanoJan 8, 2016
  3. Mike HommeyJan 8, 2016
  4. Junio C HamanoJan 8, 2016
  5. Junio C HamanoJan 9, 2016
  6. Mike HommeyJan 9, 2016
  7. Mike HommeyJan 9, 2016
  8. Junio C HamanoJan 9, 2016
  9. Mike HommeyJan 9, 2016
  10. Junio C HamanoJan 11, 2016
  11. Philip OakleyJan 9, 2016
  12. Junio C HamanoJan 11, 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.