From: Adam Simpkins <adam@adamsimpkins.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Teemu Likonen <tlikonen@iki.fi>,
Adam Simpkins <adam@adamsimpkins.net>
Subject: [PATCH 1/1] graph API: always print 'M' for merge commits
Date: Sat, 24 May 2008 13:52:01 -0700 [thread overview]
Message-ID: <1211662321-28846-2-git-send-email-adam@adamsimpkins.net> (raw)
In-Reply-To: <1211662321-28846-1-git-send-email-adam@adamsimpkins.net>
The recent changes for handling uninteresting commits changed the
behavior so that merge commits were displayed as 'M' only if they had
multiple interesting parents.
This change reverts to the old behavior of displaying merges as 'M',
even if they have less than 2 parents displayed in the graph.
---
graph.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/graph.c b/graph.c
index add7e44..ba9ede0 100644
--- a/graph.c
+++ b/graph.c
@@ -566,15 +566,17 @@ void graph_output_commit_line(struct git_graph *graph, struct strbuf *sb)
if (col_commit == graph->commit) {
seen_this = 1;
/*
- * If the commit has more than 1 interesting
- * parent, print 'M' to indicate that it is a
- * merge. Otherwise, print '*'.
+ * If the commit is a merge, print 'M'. Otherwise,
+ * print '*'.
*
- * Note that even if this is actually a merge
- * commit, we still print '*' if less than 2 of its
- * parents are interesting.
+ * Note that we don't check graph->num_parents to
+ * determine if the commit is a merge, since that
+ * only tracks the number of "interesting" parents.
+ * We want to print 'M' for merge commits even if
+ * they have less than 2 interesting parents.
*/
- if (graph->num_parents > 1)
+ if (graph->commit->parents != NULL &&
+ graph->commit->parents->next != NULL)
strbuf_addch(sb, 'M');
else
strbuf_addch(sb, '*');
--
1.5.5.1.385.ge74ed
next prev parent reply other threads:[~2008-05-24 20:52 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 ` [PATCH 1/2] graph API: fix graph mis-alignment after uninteresting commits Adam Simpkins
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 ` Adam Simpkins [this message]
2008-05-24 22:21 ` [PATCH 1/1] " 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=1211662321-28846-2-git-send-email-adam@adamsimpkins.net \
--to=adam@adamsimpkins.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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).