git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Kevin Bracey <kevin@bracey.fi>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Git mailing list" <git@vger.kernel.org>
Subject: Re: Weird revision walk behaviour
Date: Thu, 31 May 2018 01:43:55 -0400	[thread overview]
Message-ID: <20180531054355.GA17344@sigill.intra.peff.net> (raw)
In-Reply-To: <97644280-2187-d314-37ce-2c79935a63bc@bracey.fi>

On Wed, May 30, 2018 at 11:20:40AM +0300, Kevin Bracey wrote:

> 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

  reply	other threads:[~2018-05-31  5:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 17:10 Weird revision walk behaviour SZEDER Gábor
2018-05-23 17:32 ` Jeff King
2018-05-23 17:35   ` Jeff King
2018-05-24 18:54     ` Kevin Bracey
2018-05-24 20:26     ` Kevin Bracey
2018-05-27 17:37       ` Kevin Bracey
2018-05-28 22:06         ` SZEDER Gábor
2018-05-29  6:11           ` Kevin Bracey
2018-05-29 21:04           ` Jeff King
2018-05-30  8:20             ` Kevin Bracey
2018-05-31  5:43               ` Jeff King [this message]
2018-05-31 14:54                 ` Kevin Bracey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180531054355.GA17344@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kevin@bracey.fi \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).