git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Adam Simpkins <adam@adamsimpkins.net>
Cc: git@vger.kernel.org, Teemu Likonen <tlikonen@iki.fi>
Subject: Re: [PATCH 2/2] graph API: avoid printing unnecessary padding before some octopus merges
Date: Sun, 01 Jun 2008 14:50:34 -0700	[thread overview]
Message-ID: <7vskvwakph.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1212353818-7031-3-git-send-email-adam@adamsimpkins.net> (Adam Simpkins's message of "Sun, 1 Jun 2008 13:56:58 -0700")

Adam Simpkins <adam@adamsimpkins.net> writes:

> When an octopus merge is printed, several lines are printed before it to
> move over existing branch lines to its right.  This is needed to make
> room for the children of the octopus merge.  For example:
>
> | | | |
> | |  \ \
> | |   \ \
> | |    \ \
> | M---. \ \
> | |\ \ \ \ \
>
> However, this step isn't necessary if there are no branch lines to the
> right of the octopus merge.  Therefore, skip this step when it is not
> needed, to avoid printing extra lines that don't really serve any
> purpose.
>
> Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
> ---
>  graph.c |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/graph.c b/graph.c
> index 332d1e8..0531716 100644
> --- a/graph.c
> +++ b/graph.c
> @@ -450,16 +450,18 @@ void graph_update(struct git_graph *graph, struct commit *commit)
>  	 * it never finished its output.  Goto GRAPH_SKIP, to print out
>  	 * a line to indicate that portion of the graph is missing.
>  	 *
> -	 * Otherwise, if there are 3 or more parents, we need to print
> -	 * extra rows before the commit, to expand the branch lines around
> -	 * it and make room for it.
> +	 * If there are 3 or more parents, we may need to print extra rows
> +	 * before the commit, to expand the branch lines around it and make
> +	 * room for it.  We need to do this unless there aren't any branch
> +	 * rows to the right of this commit.

Double negation like this is confusing, isn't it?

"We do not have to do this if there isn't any branch row to the right of
this commit" may be better.  "We need to do this only if there is a branch
row (or more) to the right of this commit" would probably be better.

Other than that, the code looks sane to me.

  reply	other threads:[~2008-06-01 21:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-28 11:24 log --graph: extra space with --pretty=oneline Teemu Likonen
2008-05-28 11:34 ` Wincent Colaiuta
2008-05-29  8:57 ` Adam Simpkins
2008-05-29  9:03   ` [PATCH] graph API: improve output for merge commits (option 1) Adam Simpkins
2008-05-29  9:04   ` [PATCH] graph API: improve output for merge commits (option 2) Adam Simpkins
2008-05-29 10:25   ` log --graph: extra space with --pretty=oneline Teemu Likonen
2008-06-01 20:56   ` [PATCH 0/2] graph API: improve printing of merges Adam Simpkins
2008-06-01 20:56     ` [PATCH 1/2] graph API: improve display of merge commits Adam Simpkins
2008-06-01 20:56       ` [PATCH 2/2] graph API: avoid printing unnecessary padding before some octopus merges Adam Simpkins
2008-06-01 21:50         ` Junio C Hamano [this message]
2008-06-02  0:04           ` Adam Simpkins
2008-06-02  4:41             ` 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=7vskvwakph.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=adam@adamsimpkins.net \
    --cc=git@vger.kernel.org \
    --cc=tlikonen@iki.fi \
    /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).