git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFH] revision limiting sometimes ignored
Date: Sat, 02 Feb 2008 22:39:18 -0800	[thread overview]
Message-ID: <7vr6fuzgq1.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080203043310.GA5984@coredump.intra.peff.net> (Jeff King's message of "Sat, 2 Feb 2008 23:33:10 -0500")

Jeff King <peff@peff.net> writes:

> On Sat, Feb 02, 2008 at 10:00:54PM -0500, Jeff King wrote:
>
>> That being said, the commit in your 'master' branch _is_ part of
>> 1dd567d5, and should be culled. So I'm not clear on why it shows up only
>> when you ask to see both branches, and that may be a bug.
>
> OK, there is definitely a bug here, but I'm having some trouble figuring
> out the correct fix. It's in the revision walker, so I have cc'd those
> who are more clueful than I.
>
> You can recreate a problematic repo using this script:
>
> -- >8 --
> mkdir repo && cd repo
> git init
>
> touch file && git add file
> commit() {
>   echo $1 >file && git commit -a -m $1 && git tag $1
> }
>
> commit one
> commit two
> commit three
> git checkout -b other two
> commit alt-three
> git checkout master
> git merge other || true
> commit merged
> commit four
> -- 8< --
>
> So a fairly simple repo, but with the key element that it contains a
> merge.

It is not so simple, it appears.  If I add for reproducibility
"test_tick" like this:

        commit () {
                test_tick &&
                echo $1 >file &&
                git commit -a -m $1 &&
                git tag $1
        }

the problem goes away.

So there is some interaction with "insert_by_date()".  Still
digging.

 t/t6009-rev-list-parent.sh |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
new file mode 100755
index 0000000..66164e9
--- /dev/null
+++ b/t/t6009-rev-list-parent.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+test_description='properly cull all ancestors'
+
+. ./test-lib.sh
+
+commit () {
+	: test_tick &&
+	echo $1 >file &&
+	git commit -a -m $1 &&
+	git tag $1
+}
+
+test_expect_success setup '
+
+	touch file &&
+	git add file &&
+
+	commit one &&
+	commit two &&
+	commit three &&
+
+	git checkout -b other two &&
+	commit alt-three &&
+
+	git checkout master &&
+
+	git merge -s ours other &&
+
+	commit merged &&
+	commit four &&
+
+	git -p show-branch --more=999
+
+'
+
+test_expect_failure 'one is ancestor of others and should not be shown' '
+
+	git rev-list one --not four >result &&
+	>expect &&
+	diff -u expect result 
+
+'

  parent reply	other threads:[~2008-02-03  6:40 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02 12:21 [BUG?] git log picks up bad commit Tilman Sauerbeck
2008-02-03  3:00 ` Jeff King
2008-02-03  4:33   ` [RFH] revision limiting sometimes ignored Jeff King
2008-02-03  6:24     ` Junio C Hamano
2008-02-03  6:39     ` Junio C Hamano [this message]
2008-02-03  7:13       ` Jeff King
2008-02-03  7:18         ` Jeff King
2008-02-03  7:40           ` Junio C Hamano
2008-02-03  7:47             ` Junio C Hamano
2008-02-03  8:18           ` Junio C Hamano
2008-02-04 17:32     ` Linus Torvalds
2008-02-04 17:37       ` Linus Torvalds
2008-02-04 19:08       ` Junio C Hamano
2008-02-04 20:03         ` Linus Torvalds
2008-02-04 20:06           ` Linus Torvalds
2008-02-04 20:50           ` Linus Torvalds
2008-02-05  7:14             ` Junio C Hamano
2008-02-05 21:23               ` Linus Torvalds
2008-02-05 22:34                 ` Johannes Schindelin
2008-02-05 23:59                   ` Linus Torvalds
2008-02-06 16:43                     ` Tilman Sauerbeck
2008-02-06 17:28                       ` Nicolas Pitre
2008-02-06 17:42                         ` Linus Torvalds
2008-02-06 17:48                           ` Nicolas Pitre
2008-02-06 19:26                       ` Linus Torvalds
2008-02-06  1:22                   ` Nicolas Pitre
2008-02-06  1:51                   ` Junio C Hamano
2008-02-06  6:05                     ` Junio C Hamano
2008-02-06  6:17                       ` Junio C Hamano
2008-02-05 23:44                 ` Junio C Hamano
2008-02-06  0:52                   ` Linus Torvalds
2008-02-06  5:30                     ` Junio C Hamano
2008-02-06  8:16                       ` Karl Hasselström
2008-02-06 10:34                       ` Linus Torvalds

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=7vr6fuzgq1.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).