git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Lars Hjemli" <hjemli@gmail.com>
Cc: "Stephen R. van den Berg" <srb@cuci.nl>,
	nanako3@bluebottle.com, git@vger.kernel.org
Subject: Re: [PATCH v2] revision.c: really honor --first-parent
Date: Tue, 13 May 2008 15:38:37 -0700	[thread overview]
Message-ID: <7vej85suc2.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 8c5c35580805131343kc115df6yd7ce3281fb3e6171@mail.gmail.com

"Lars Hjemli" <hjemli@gmail.com> writes:

>>  - My original patch did just that, it simplified the code to make sure
>>   that all other parents beside the first parent are ignored when
>>   walking the tree.
>
> Except for the case where the first parent had been already SEEN; then
> it would continue to test the next parents until one was found which
> was not already SEEN and _that_ parent would be treated as if it was
> first. And as Nanako showed, a simple `git rev-list HEAD^..HEAD` marks
> both HEAD and HEAD^ as seen. When combined with --first-parent, the
> result (with your patch) is that HEAD^2 is treated as the first
> parent. With my patch on top of yours, the walk stops as HEAD^, which
> is what we probably both want.
>
>>  - Your code now doesn't simplify the (IMO) convoluted walk, and still
>>   marks things as seen, even though in the first-parent case, these
>>   commits are not really seen at all.  It implies that your code
>>   generates differing output, depending on the merges present.
>
> I don't think so. My code should neither follow nor mark as SEEN any
> parent but the first (but I could obviously be wrong).

A major part of the "convoluted walk" is the (il-)logic that skipped
earlier SEEN parents and treated the first unseen one as if it was the
first parent, which is not exactly Stephen's fault.  It was placed by
yours truly in the very original code but it was done without much
thought.

I think your patch is the correct fix for that convolution, regardless of
the traversal order stability issue Stephen mentions.

  reply	other threads:[~2008-05-13 22:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11  7:03 "git log --first-parent" shows parents that are not first しらいしななこ
2008-05-11 18:44 ` Junio C Hamano
2008-05-11 23:14   ` [PATCH] revision.c: really honor --first-parent Lars Hjemli
2008-05-12 15:12     ` [PATCH v2] " Lars Hjemli
2008-05-13 20:15       ` Stephen R. van den Berg
2008-05-13 20:43         ` Lars Hjemli
2008-05-13 22:38           ` Junio C Hamano [this message]
2008-05-14 10:34             ` Stephen R. van den Berg
2008-05-14 10:54               ` Lars Hjemli
2008-05-14 11:10                 ` Stephen R. van den Berg

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

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

  git send-email \
    --in-reply-to=7vej85suc2.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=hjemli@gmail.com \
    --cc=nanako3@bluebottle.com \
    --cc=srb@cuci.nl \
    /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.
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 NNTP newsgroup(s).