summaryrefslogtreecommitdiff
path: root/t/t6200-fmt-merge-msg.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2010-09-08 17:59:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-09-09 18:39:25 (GMT)
commitb928cbf120a8f6d1d435849fb1fcf1c64489dc4c (patch)
tree5b442e30453fed7c23016fe711676ac6ac795a97 /t/t6200-fmt-merge-msg.sh
parentbda3b8ff1735aecfb5265ed781548eab238d7a14 (diff)
downloadgit-b928cbf120a8f6d1d435849fb1fcf1c64489dc4c.zip
git-b928cbf120a8f6d1d435849fb1fcf1c64489dc4c.tar.gz
git-b928cbf120a8f6d1d435849fb1fcf1c64489dc4c.tar.bz2
t6200-fmt-merge-msg: Exercise 'merge.log' to configure shortlog length
Add a test to exercise the 'merge.log' configuration option of 'git fmt-merge-msg'. It controls the number of shortlog entries to display in merge commit messages. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Thanks-to: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6200-fmt-merge-msg.sh')
-rwxr-xr-xt/t6200-fmt-merge-msg.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 71f6cad..9b600a8 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -129,6 +129,54 @@ test_expect_success '[merge] summary/log configuration' '
test_cmp expected actual2
'
+test_expect_success 'setup: clear [merge] configuration' '
+ test_might_fail git config --unset-all merge.log &&
+ test_might_fail git config --unset-all merge.summary
+'
+
+test_expect_success 'setup FETCH_HEAD' '
+ git checkout master &&
+ test_tick &&
+ git fetch . left
+'
+
+test_expect_success 'merge.log=3 limits shortlog length' '
+ cat >expected <<-EOF &&
+ Merge branch ${apos}left${apos}
+
+ * left: (5 commits)
+ Left #5
+ Left #4
+ Left #3
+ ...
+ EOF
+
+ git -c merge.log=3 fmt-merge-msg <.git/FETCH_HEAD >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'merge.log=5 shows all 5 commits' '
+ cat >expected <<-EOF &&
+ Merge branch ${apos}left${apos}
+
+ * left:
+ Left #5
+ Left #4
+ Left #3
+ Common #2
+ Common #1
+ EOF
+
+ git -c merge.log=5 fmt-merge-msg <.git/FETCH_HEAD >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'merge.log=0 disables shortlog' '
+ echo "Merge branch ${apos}left${apos}" >expected
+ git -c merge.log=0 fmt-merge-msg <.git/FETCH_HEAD >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'fmt-merge-msg -m' '
echo "Sync with left" >expected &&
cat >expected.log <<-EOF &&