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

Re: Weird revision walk behaviour

From
Jeff King <peff@peff.net>
Date
May 31, 2018, 05:43 UTC
Message-ID
<20180531054355.GA17344@sigill.intra.peff.net>
In-Reply-To
<97644280-2187-d314-37ce-2c79935a63bc@bracey.fi>
On Wed, May 30, 2018 at 11:20:40AM +0300, Kevin Bracey wrote:
Show 23 quoted lines
> On 30/05/2018 00:04, Jeff King wrote:
> > 
> > Do we even need to do the parent rewriting here? By definition those
> > parents aren't interesting, and we're TREESAME to whatever is in
> > treesame_parents. So conceptually it seems like we just need a flag "I
> > found a treesame parent", but we only convert that into a TREESAME flag
> > if there are no relevant parents.
> 
> I think it's necessary to make the rules consistent. To mark the commit as
> TREESAME here when it's not TREESAME to all its parents would be
> inconsistent with the definition of the TREESAME flag used everywhere else:
> 
> * Original definition: "A commit is TREESAME if it is treesame to any
> parent"
> * d0af66 definition: "A commit is TREESAME if it is treesame to all parents"
> * Current 4d8266 definition: "A commit is TREESAME if it is treesame to all
> relevant parents; if no relevant parents then if it is treesame to all
> (irrelevant) parents."
> 
> The current problem is that the node is not marked TREESAME, but that's
> consistent with the definition. I think we do have to rewrite the commit so
> it is TREESAME as per the definition. Not flag it as TREESAME in violation
> of it.

If there are zero parents (neither relevant nor irrelevant), is it still TREESAME? I would say in theory yes. So what I was proposing would be to rewrite the parents to the empty set.

But anyway, I agree with you that the first-treesame-parent strategy is not any more complex than the boolean, and is probably less likely to cause unintended headaches later on.

What next here? It looks like we have a proposed solution. Do you want to try to work up a set of tests based on what you wrote earlier?

I'd also love to hear from Junio as the expert in this area, but I think he's been a bit busy with maintainer stuff recently. So maybe I should just be patient. :)

-Peff
Previous: Kevin BraceyNext: Kevin Bracey
Message 11 of 12 in “Weird revision walk behaviour”
  1. SZEDER GáborMay 23, 2018
  2. Jeff KingMay 23, 2018
  3. Jeff KingMay 23, 2018
  4. Kevin BraceyMay 24, 2018
  5. Kevin BraceyMay 24, 2018
  6. Kevin BraceyMay 27, 2018
  7. SZEDER GáborMay 28, 2018
  8. Kevin BraceyMay 29, 2018
  9. Jeff KingMay 29, 2018
  10. Kevin BraceyMay 30, 2018
  11. Jeff KingMay 31, 2018
  12. Kevin BraceyMay 31, 2018

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.