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: Mon, 24 Sep 2012 16:36:31 -0700	[thread overview]
Message-ID: <7vtxunvvr4.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CACsJy8ApYKOU8v_-HkUC5uOb8gsheugKaXKMjbm0_-ygW_4jiQ@mail.gmail.com> (Nguyen Thai Ngoc Duy's message of "Sun, 23 Sep 2012 19:14:51 +0700")

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> On Sun, Sep 23, 2012 at 6:55 PM, Michal Kiedrowicz
> <michal.kiedrowicz@gmail.com> wrote:
>> Nguyễn Thái Ngọc Duy <pclouds <at> gmail.com> writes:
>>
>>>
>>> The loop can be triggered with "git diff-tree --graph commit" where
>>> the commit is a non-merge. It goes like this
>>
>>
>> Isn't this the same issue as in
>> http://article.gmane.org/gmane.comp.version-control.git/123979
>> ? (with slightly different fix)
>
> I don't know. I'm not familiar enough with graph.c to tell. Maybe Adam
> can have a look?

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.

But I didn't look at it too closely.  I'd prefer to see the
assert(0) turned into die("BUG: internal error") at the end of
graph_next_line() to catch these cases.  Also I am not sure if
assignment of the return value from graph_next_line() to
shown_comit_line in the loop is correct (shouldn't it be OR'ing it
in, so that "we have shown the information on this commit" is not
lost when the function adds things after showing the commit???)

  reply	other threads:[~2012-09-24 23:36 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 [this message]
2012-09-25 18:11       ` 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=7vtxunvvr4.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.