Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] merge-base.c: pathological case fix.
Date: Thu, 11 Aug 2005 22:27:51 -0700	[thread overview]
Message-ID: <7vwtmr912g.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 7vk6isc5x1.fsf_-_@assigned-by-dhcp.cox.net

I wrote:

> + *                  F
> + *                 / \
> + *            E   A   D
> + *             \ /   /  
> + *              B   /
> + *               \ /
> + *                C
> + *
> + * First we push E and F to list to be processed.  E gets bit 1
> + * and F gets bit 2.  The list becomes:
> + * ...
> + * Next, we pop B and something very interesting happens.  It has flags==3
> + * so it is also placed on the result list, and its parents are marked
> + * uninteresting, retroactively, and placed back on the list:
> + *
> + *    list=C(7), result=C(7) B(3)
> + * 
> + * Now, list does not have any interesting commit.  So we find the newest
> + * commit from the result list that is not marked uninteresting.  Which is
> + * commit B.

I suspect we could have "list" where all commits on it is
uninteresting, while "result" has an interesting commit that
turns out to be reachable from one of the uninteresting commits
that is still on "list", and we miss it because we give up as
soon as "list" contains nothing but uninteresting ones.

I have not come up with such a pathological example, but if that
is indeed the case, we would still end up terminating the
well-contamination too early.  I have a suspicion that no matter
how we cut it we would have this horizon effect anyway, and if
we want to really do the perfect job then we cannot avoid
traversing to the root.

Since merge-base is aiming to be a heuristic that works well
enough in practice, I think we should declare victory now and
not aim for perfection, which is an enemy of the good.

      reply	other threads:[~2005-08-12  5:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7virydlzal.fsf@assigned-by-dhcp.cox.net>
     [not found] ` <Pine.LNX.4.58.0508110840080.3295@g5.osdl.org>
     [not found]   ` <7vbr44f5s1.fsf@assigned-by-dhcp.cox.net>
     [not found]     ` <Pine.LNX.4.58.0508111601000.3295@g5.osdl.org>
2005-08-12  1:14       ` [PATCH] merge-base.c: pathological case fix Junio C Hamano
2005-08-12  5:27         ` Junio C Hamano [this message]

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=7vwtmr912g.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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