git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: log --graph --first-parent weirdness

From
Adam Simpkins <adam@adamsimpkins.net>
Date
Jun 5, 2008, 09:28 UTC
Message-ID
<20080605092812.GA14116@adamsimpkins.net>
In-Reply-To
<7v1w3dxeh9.fsf@gitster.siamese.dyndns.org>
On Wed, Jun 04, 2008 at 11:05:38AM -0700, Junio C Hamano wrote:
> 
> I'd really suggest changing the "M" and use "*" everywhere.
That's fine with me.  Here's a simple patch to change the behavior.

-- >8 -- "git log --graph": print '*' for all commits, including merges

Previously, merge commits were printed with 'M' instead of '*'. This had the potential to confuse users when not all parents of the merge commit were included in the log output.

As Junio has pointed out, merge commits can almost always be easily identified from the log message, anyway.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
---
 graph.c |   14 --------------
 1 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/graph.c b/graph.c
index edfab2d..c50adcd 100644
--- a/graph.c
+++ b/graph.c
@@ -638,20 +638,6 @@ static void graph_output_commit_char(struct git_graph *graph, struct strbuf *sb)
 	}
 
 	/*
-	 * Print 'M' for merge commits
-	 *
-	 * 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->commit->parents != NULL &&
-	    graph->commit->parents->next != NULL) {
-		strbuf_addch(sb, 'M');
-		return;
-	}
-
-	/*
 	 * Print '*' in all other cases
 	 */
 	strbuf_addch(sb, '*');
-- 
1.5.6.rc1.13.g14be6
Previous: Ping YinNext: Teemu Likonen
Message 9 of 11 in “log --graph --first-parent weirdness”
  1. Teemu LikonenJun 4, 2008
  2. Teemu LikonenJun 4, 2008
  3. Junio C HamanoJun 4, 2008
  4. Teemu LikonenJun 4, 2008
  5. Adam SimpkinsJun 4, 2008
  6. graph API: fix "git log --graph --first-parent"Adam Simpkins, Jun 5, 2008
  7. Junio C HamanoJun 4, 2008
  8. Ping YinJun 5, 2008
  9. Adam SimpkinsJun 5, 2008
  10. Teemu LikonenJun 5, 2008
  11. Junio C HamanoJun 5, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.