From: Junio C Hamano <junkio@cox.net>
To: "Santi Béjar" <sbejar@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: [BUG] git-rev-list: --topo-order --boundary and --max-count
Date: Mon, 05 Mar 2007 04:15:24 -0800	[thread overview]
Message-ID: <7vhcszzy1v.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vlkicynwm.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Mon, 05 Mar 2007 02:39:53 -0800")
Junio C Hamano <junkio@cox.net> writes:
> "Santi Béjar" <sbejar@gmail.com> writes:
>
>>  the --topo-order does not play well with --boundary and --max-count.
>>
>> $ git-rev-list --boundary --max-count=50 5ced0 | wc -l
>> 56
>> $ git-rev-list --topo-order --boundary --max-count=50 5ced0 | wc -l
>> 8846
>>
>> (5ced0 is git.git's master). I think it should be 56 for both. It
>> presents this behaviour since c4025103fa, when was added --boundary
>> support for git-rev-list --max-count and --max-age.
>
> I think the code that does --boundary when the list is limited
> with --max-count is not quite right, even without topo-order.
> Only when the traversal is not limited, the code happens to work
> correctly because in that case alone we pick up positive commits
> one by one up to the specified count, and do not place anything
> other than their immediate parents in the list.
This is not even correct.  Let's see an extreme example.
Suppose you have something like this:
 ---o---o---o---x---A
 
   ---o---o---o---y---B
and think about what "rev-list --boundary --max-count=1 A B"
should return.  It does not matter how branches A and B are
related in the past because we are showing only one.
Without --boundary, it is clear we will show B (time flows from
left to right).  With --boundary, the current code would show B,
and show -y and -A as boundaries, and I think that is wrong.
Originally --boundary was invented for the specific purpose of
supporting thin packs.  It worked on the set of commits
resulting from a limited traversal (that is, you have at least
one negative, iow UNINTERESTING, commit and one or more positive
commits), and it showed the negative commit that is a parent of
a positive commit.
There are two primary users of --boundary right now.  gitk wants
to show where the partial traversal ends (although it can figure
it out itself without help from --boundary), and thin pack
generation wants to have it upfront so that it can see which
trees and blobs can be used as the bases of delta.  In both
cases, the semantics desired is to show commits that are _not_
included in the usual (i.e. non --boundary) results that are
immediate parents of the commits that are included in the
result.
So with that definition, the above example should show B and
then -y as boundary, and should not even talk about A nor -x.
This may affect the git-bundle's computation of references
included in the bundle (I think the current code assumes that if
you do "git bundle --max-count=1 A B" the resulting bundle says
its set of tips consists of A and B) but if that is broken it
also needs to be fixed.
next prev parent reply	other threads:[~2007-03-05 12:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-05 10:02 [BUG] git-rev-list: --topo-order --boundary and --max-count Santi Béjar
2007-03-05 10:39 ` Junio C Hamano
2007-03-05 12:15   ` Junio C Hamano [this message]
2007-03-05 17:05   ` Linus Torvalds
2007-03-05 18:55   ` [PATCH] revision walker: Fix --boundary when limited Johannes Schindelin
2007-03-05 19:00     ` Johannes Schindelin
2007-03-05 19:39     ` Linus Torvalds
2007-03-05 19:57       ` Linus Torvalds
2007-03-05 21:10         ` Junio C Hamano
2007-03-06  1:12           ` Johannes Schindelin
2007-03-06  1:32             ` Junio C Hamano
2007-03-06  1:44               ` Johannes Schindelin
2007-03-06  1:58                 ` Junio C Hamano
2007-03-05 23:17         ` Johannes Schindelin
2007-03-06  0:36           ` Junio C Hamano
2007-03-06  0:41             ` [PATCH 2/4] revision traversal: retire BOUNDARY_SHOW Junio C Hamano
2007-03-06  2:05               ` Johannes Schindelin
2007-03-06  2:17                 ` Junio C Hamano
2007-03-06  2:23                   ` SHOWN means shown Junio C Hamano
2007-03-06  2:29                   ` [PATCH 2/4] revision traversal: retire BOUNDARY_SHOW Johannes Schindelin
2007-03-06 11:34                     ` Junio C Hamano
2007-03-06 15:52                       ` Johannes Schindelin
2007-03-06  0:41             ` [PATCH 3/4] git-bundle: various fixups Junio C Hamano
2007-03-06  2:13               ` Johannes Schindelin
2007-03-06  0:41             ` [PATCH 4/4] git-bundle: --list-prereqs Junio C Hamano
2007-03-05 21:10     ` [PATCH] revision walker: Fix --boundary when limited Junio C Hamano
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=7vhcszzy1v.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=sbejar@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.
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).