path: root/t/t4013
diff options
authorJeff King <>2020-07-29 20:10:28 (GMT)
committerJunio C Hamano <>2020-07-29 20:43:57 (GMT)
commit9ab89a2439064720cc790c4477b8e981832c43f5 (patch)
treefe7aac85ff5caabe47f64bf6405039d4f8f10435 /t/t4013
parent6fae74b418da05a80897487805c833fd0b253df3 (diff)
log: enable "-m" automatically with "--first-parent"
When using "--first-parent" to consider history as a single line of commits, git-log still defaults to treating merges specially, even though they could be considered as single commits in the linearized history (that just introduce all of the changes from the second and higher parents). Let's instead have "--first-parent" imply "-m", which makes something like: git log --first-parent -p do what you'd expect. Likewise: git log --first-parent -Sfoo will find "foo" in merge commits. No new test is needed; we'll tweak the output of the existing "--first-parent -p" test, which now matches the "-m --first-parent -p" test. The unchanged existing test for "--no-diff-merges" confirms that the user can get the old behavior if they want. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/t4013')
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t4013/diff.log_-p_--first-parent_master b/t/t4013/diff.log_-p_--first-parent_master
index c6a5876..fe04439 100644
--- a/t/t4013/diff.log_-p_--first-parent_master
+++ b/t/t4013/diff.log_-p_--first-parent_master
@@ -6,6 +6,28 @@ Date: Mon Jun 26 00:04:00 2006 +0000
Merge branch 'side' into master
+diff --git a/dir/sub b/dir/sub
+index cead32e..992913c 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -4,3 +4,5 @@ C
+ D
+ E
+ F
+diff --git a/file0 b/file0
+index b414108..10a8a9f 100644
+--- a/file0
++++ b/file0
+@@ -4,3 +4,6 @@
+ 4
+ 5
+ 6
commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
Author: A U Thor <>
Date: Mon Jun 26 00:02:00 2006 +0000