git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Simpkins <adam@adamsimpkins.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Adam Simpkins <adam@adamsimpkins.net>
Subject: [PATCH 1/2] graph API: fix graph mis-alignment after uninteresting commits
Date: Fri, 23 May 2008 19:24:10 -0700	[thread overview]
Message-ID: <1211595851-11992-2-git-send-email-adam@adamsimpkins.net> (raw)
In-Reply-To: <1211595851-11992-1-git-send-email-adam@adamsimpkins.net>

The graphing code had a bug that caused it to output branch lines
incorrectly after ignoring an uninteresting commit.  When computing how
to match up the branch lines from the current commit to the next one, it
forgot to take into account that it needed to initially start with 2
empty spaces where the missing commit would have gone.

So, instead of drawing this,

| * | <- Commit with uninteresting parent
|  /
* |

It used to incorrectly draw this:

| * | <- Commit with uninteresting parent
* |

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
---
 graph.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/graph.c b/graph.c
index 9d6ed30..400f014 100644
--- a/graph.c
+++ b/graph.c
@@ -190,7 +190,10 @@ static void graph_insert_into_new_columns(struct git_graph *graph,
 	 * Ignore uinteresting and pruned commits
 	 */
 	if (commit->object.flags & (UNINTERESTING | TREESAME))
+	{
+		*mapping_index += 2;
 		return;
+	}
 
 	/*
 	 * If the commit is already in the new_columns list, we don't need to
-- 
1.5.5.1.359.gebc23.dirty

  reply	other threads:[~2008-05-24  2:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23 20:42 bug in "git log --graph" at the tail end? Junio C Hamano
2008-05-23 21:02 ` Reece Dunn
2008-05-24  1:05 ` Adam Simpkins
2008-05-24  1:39   ` Junio C Hamano
2008-05-24  2:24     ` [PATCH 0/2] fix "log --graph" issues with uninteresting parents Adam Simpkins
2008-05-24  2:24       ` Adam Simpkins [this message]
2008-05-24  2:24         ` [PATCH 2/2] graph API: don't print branch lines for uninteresting merge parents Adam Simpkins
2008-05-24 18:25           ` Teemu Likonen
2008-05-24 20:52             ` [PATCH 0/1] graph API: always print 'M' for merge commits Adam Simpkins
2008-05-24 20:52               ` [PATCH 1/1] " Adam Simpkins
2008-05-24 22:21                 ` Adam Simpkins
2008-05-25  1:28               ` [PATCH 0/1] " Junio C Hamano
2008-05-25  6:29                 ` Teemu Likonen
2008-05-25  6:49                 ` Adam Simpkins
2008-05-24 22:21           ` [PATCH 2/2] graph API: don't print branch lines for uninteresting merge parents Adam Simpkins

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=1211595851-11992-2-git-send-email-adam@adamsimpkins.net \
    --to=adam@adamsimpkins.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).