Skip to content

Commit

Permalink
t6200-fmt-merge-msg: Exercise '--log' to configure shortlog length
Browse files Browse the repository at this point in the history
Add a test to exercise the '--log' command-line 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>
  • Loading branch information
Ramkumar Ramachandra authored and Junio C Hamano committed Sep 9, 2010
1 parent b928cbf commit bd2549c
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions t/t6200-fmt-merge-msg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,49 @@ test_expect_success 'merge.log=0 disables shortlog' '
test_cmp expected actual
'

test_expect_success '--log=3 limits shortlog length' '
cat >expected <<-EOF &&
Merge branch ${apos}left${apos}
* left: (5 commits)
Left #5
Left #4
Left #3
...
EOF
git fmt-merge-msg --log=3 <.git/FETCH_HEAD >actual &&
test_cmp expected actual
'

test_expect_success '--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 fmt-merge-msg --log=5 <.git/FETCH_HEAD >actual &&
test_cmp expected actual
'

test_expect_success '--no-log disables shortlog' '
echo "Merge branch ${apos}left${apos}" >expected &&
git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual &&
test_cmp expected actual
'

test_expect_success '--log=0 disables shortlog' '
echo "Merge branch ${apos}left${apos}" >expected &&
git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual &&
test_cmp expected actual
'

test_expect_success 'fmt-merge-msg -m' '
echo "Sync with left" >expected &&
cat >expected.log <<-EOF &&
Expand Down

0 comments on commit bd2549c

Please sign in to comment.