git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: John Keeping <john@keeping.me.uk>
Cc: git@vger.kernel.org, "Matthieu Moy" <Matthieu.Moy@imag.fr>,
	"Michał Kiedrowicz" <michal.kiedrowicz@gmail.com>
Subject: Re: [PATCH] fixup! graph: output padding for merge subsequent parents
Date: Sun, 10 Feb 2013 14:38:46 -0800	[thread overview]
Message-ID: <7vwqufrdzd.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20130210210229.GB2270@serenity.lan> (John Keeping's message of "Sun, 10 Feb 2013 21:02:29 +0000")

John Keeping <john@keeping.me.uk> writes:

> On Sun, Feb 10, 2013 at 11:30:39AM -0800, Junio C Hamano wrote:
> ...
>> Is it correct to say that this essentially re-does 656197ad3805
>> (graph.c: infinite loop in git whatchanged --graph -m, 2009-07-25)
>> in a slightly different way, in that Michał's original fix also
>> protected against the case where graph->state is flipped to
>> GRAPH_PADDING by graph_next_line() that returns false, but with your
>> fixup, the code knows it never happens (i.e. when graph_next_line()
>> returns false, graph->state is always in the GRAPH_PADDING state),
>> and the only thing we need to be careful about is when graph->state
>> is already in the PADDING state upon entry to this function?
>
> Yes, although I wonder if we can end up in POST_MERGE or COLLAPSING
> state here as well.  The check in the loop guards against that because
> those will eventually end up as PADDING.
>
> As far as I can see, this is okay because we have called
> graph_show_remainder() at the end of outputting a commit, even when we
> end up outputting the same (merge) commit more than once.  But someone
> more familiar with the graph code might want to comment here.

More importantly, that kind of thought process needs to be
documented in the log message; that will help people to diagnose the
cause of the problem if they later find that this patch made an
incorrect assumption while simplifying the code.

  reply	other threads:[~2013-02-10 22:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09 23:39 What's cooking in git.git (Feb 2013, #04; Sat, 9) Junio C Hamano
2013-02-10 13:16 ` [PATCH] fixup! graph: output padding for merge subsequent parents John Keeping
2013-02-10 19:30   ` Junio C Hamano
2013-02-10 21:02     ` John Keeping
2013-02-10 22:38       ` Junio C Hamano [this message]
2013-02-11 10:54         ` John Keeping
2013-02-11 16:42           ` Junio C Hamano
2013-02-11 19:06             ` John Keeping
2013-02-11 19:58               ` Junio C Hamano
2013-02-11  9:14 ` What's cooking in git.git (Feb 2013, #04; Sat, 9) Matthieu Moy
2013-02-11 16:01   ` 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=7vwqufrdzd.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=john@keeping.me.uk \
    --cc=michal.kiedrowicz@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).