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

git log: don't do merge diffs by default

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 19, 2006, 17:20 UTC
Message-ID
<Pine.LNX.4.64.0604191015150.3701@g5.osdl.org>

I personally prefer "ignore_merges" to be on by default, because quite often the merge diff is distracting and not interesting. That's true both with "-p" and with "--stat" output.

If you want output from merges, you can trivially use the "-m", "-c" or "--cc" flags to tell that you're interested in merges, which also tells the diff generator what kind of diff to do (for --stat, any of the three will do, of course, but they differ for plain patches or for --patch-with-stat).

This trivial patch just removes the two lines that tells "git log" not to ignore merges. It will still show the commit log message, of course, due to the "always_show_header" part.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/git.c b/git.c
index 0be14bb..40b7e42 100644
--- a/git.c
+++ b/git.c
@@ -331,8 +331,6 @@ static int cmd_log(int argc, const char 
 	init_revisions(&rev);
 	rev.always_show_header = 1;
 	rev.diffopt.recursive = 1;
-	rev.combine_merges = 1;
-	rev.ignore_merges = 0;
 	return cmd_log_wc(argc, argv, envp, &rev);
 }
 
Message 1 of 1 in “git log: don't do merge diffs by default”
  1. Linus TorvaldsApr 19, 2006

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.