All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Michal Kiedrowicz <michal.kiedrowicz@gmail.com>,
	git@vger.kernel.org, adam@adamsimpkins.net
Subject: Re: [PATCH] graph: avoid infinite loop in graph_show_commit()
Date: Tue, 25 Sep 2012 11:11:17 -0700	[thread overview]
Message-ID: <7v6272vupm.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vtxunvvr4.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Mon, 24 Sep 2012 16:36:31 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Has either of you tried the patch with the problematic case the
> other patch tries to solve?  Michal's old patch does smell like it
> is going in the better direction in that it stops looping when we
> know we would only be showing the padding, which is a sign that we
> are done with showing the commit.

I think this should suffice.  I do not know if Michal's patch is the
right fix, though.  It appears to me that "--graph" assumes one
commit is shown only once, but "diff-tree -m" and friends want to
show a merge commit twice and is fundamentally incompatible with the
assumption.  We might be off either fixing that in the "graph" code
(not with a band-aid like patches from you two to make it punt), or
forbidding the combination altogether.


 t/t4202-log.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 71be59d..14f73e3 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -264,6 +264,16 @@ test_expect_success 'log --graph with merge' '
 	test_cmp expect actual
 '
 
+test_expect_success 'log --raw --graph -m with merge' '
+	git log --raw --graph --oneline -m master | head -n 500 >actual &&
+	grep "initial" actual
+'
+
+test_expect_success 'diff-tree --graph' '
+	git diff-tree --graph master^ | head -n 500 >actual &&
+	grep "one" actual
+'
+
 cat > expect <<\EOF
 *   commit master
 |\  Merge: A B
-- 
1.7.12.1.451.gb433296

      reply	other threads:[~2012-09-25 18:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-22 14:24 [PATCH] graph: avoid infinite loop in graph_show_commit() Nguyễn Thái Ngọc Duy
2012-09-23 11:55 ` Michal Kiedrowicz
2012-09-23 12:14   ` Nguyen Thai Ngoc Duy
2012-09-24 23:36     ` Junio C Hamano
2012-09-25 18:11       ` 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=7v6272vupm.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=adam@adamsimpkins.net \
    --cc=git@vger.kernel.org \
    --cc=michal.kiedrowicz@gmail.com \
    --cc=pclouds@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.