2006-07-04 05:09:54 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2006, Junio C Hamano
|
|
|
|
#
|
|
|
|
|
|
|
|
test_description='fmt-merge-msg test'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success setup '
|
|
|
|
echo one >one &&
|
|
|
|
git add one &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git commit -m "Initial" &&
|
|
|
|
|
2010-03-24 10:15:58 +03:00
|
|
|
git clone . remote &&
|
|
|
|
|
2006-07-04 05:09:54 +04:00
|
|
|
echo uno >one &&
|
|
|
|
echo dos >two &&
|
|
|
|
git add two &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git commit -a -m "Second" &&
|
|
|
|
|
|
|
|
git checkout -b left &&
|
|
|
|
|
2010-03-24 10:15:59 +03:00
|
|
|
echo "c1" >one &&
|
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git commit -a -m "Common #1" &&
|
|
|
|
|
2010-03-24 10:15:59 +03:00
|
|
|
echo "c2" >one &&
|
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git commit -a -m "Common #2" &&
|
|
|
|
|
|
|
|
git branch right &&
|
|
|
|
|
2010-03-24 10:15:59 +03:00
|
|
|
echo "l3" >two &&
|
|
|
|
test_tick &&
|
2012-03-13 21:00:00 +04:00
|
|
|
GIT_COMMITTER_NAME="Another Committer" \
|
|
|
|
GIT_AUTHOR_NAME="Another Author" git commit -a -m "Left #3" &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2010-03-24 10:15:59 +03:00
|
|
|
echo "l4" >two &&
|
|
|
|
test_tick &&
|
2012-03-13 21:00:00 +04:00
|
|
|
GIT_COMMITTER_NAME="Another Committer" \
|
|
|
|
GIT_AUTHOR_NAME="Another Author" git commit -a -m "Left #4" &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2010-03-24 10:15:59 +03:00
|
|
|
echo "l5" >two &&
|
|
|
|
test_tick &&
|
2012-03-13 21:00:00 +04:00
|
|
|
GIT_COMMITTER_NAME="Another Committer" \
|
|
|
|
GIT_AUTHOR_NAME="Another Author" git commit -a -m "Left #5" &&
|
2010-03-24 10:15:59 +03:00
|
|
|
git tag tag-l5 &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
|
|
|
git checkout right &&
|
|
|
|
|
2010-03-24 10:15:59 +03:00
|
|
|
echo "r3" >three &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git add three &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git commit -a -m "Right #3" &&
|
2010-03-24 10:15:59 +03:00
|
|
|
git tag tag-r3 &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2010-03-24 10:15:59 +03:00
|
|
|
echo "r4" >three &&
|
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git commit -a -m "Right #4" &&
|
|
|
|
|
2010-03-24 10:15:59 +03:00
|
|
|
echo "r5" >three &&
|
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git commit -a -m "Right #5" &&
|
|
|
|
|
2010-03-24 10:16:00 +03:00
|
|
|
git checkout -b long &&
|
|
|
|
i=0 &&
|
|
|
|
while test $i -lt 30
|
|
|
|
do
|
|
|
|
test_commit $i one &&
|
|
|
|
i=$(($i+1))
|
|
|
|
done &&
|
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
git show-branch &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
apos="'\''"
|
|
|
|
'
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_expect_success 'message for merging local branch' '
|
|
|
|
echo "Merge branch ${apos}left${apos}" >expected &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
|
|
|
git checkout master &&
|
|
|
|
git fetch . left &&
|
|
|
|
|
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
|
2008-05-24 09:28:56 +04:00
|
|
|
test_cmp expected actual
|
2006-07-04 05:09:54 +04:00
|
|
|
'
|
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_expect_success 'message for merging external branch' '
|
|
|
|
echo "Merge branch ${apos}left${apos} of $(pwd)" >expected &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
|
|
|
git checkout master &&
|
2009-03-14 01:35:24 +03:00
|
|
|
git fetch "$(pwd)" left &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
|
2008-05-24 09:28:56 +04:00
|
|
|
test_cmp expected actual
|
2006-07-04 05:09:54 +04:00
|
|
|
'
|
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_expect_success '[merge] summary/log configuration' '
|
|
|
|
cat >expected <<-EOF &&
|
|
|
|
Merge branch ${apos}left${apos}
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-08-17 10:57:40 +04:00
|
|
|
* left:
|
|
|
|
Left #5
|
|
|
|
Left #4
|
|
|
|
Left #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
EOF
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2008-04-06 05:23:45 +04:00
|
|
|
git config merge.log true &&
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.summary &&
|
2008-04-06 05:23:45 +04:00
|
|
|
|
|
|
|
git checkout master &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2008-04-06 05:23:45 +04:00
|
|
|
git fetch . left &&
|
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
|
2008-04-06 05:23:45 +04:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2007-01-29 03:16:53 +03:00
|
|
|
git config merge.summary true &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
|
|
|
git checkout master &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git fetch . left &&
|
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_cmp expected actual1 &&
|
|
|
|
test_cmp expected actual2
|
|
|
|
'
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2010-09-08 21:59:56 +04:00
|
|
|
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}
|
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-09-08 21:59:56 +04:00
|
|
|
* 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}
|
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-09-08 21:59:56 +04:00
|
|
|
* 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
|
|
|
|
'
|
|
|
|
|
2010-09-08 21:59:57 +04:00
|
|
|
test_expect_success '--log=3 limits shortlog length' '
|
|
|
|
cat >expected <<-EOF &&
|
|
|
|
Merge branch ${apos}left${apos}
|
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-09-08 21:59:57 +04:00
|
|
|
* 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}
|
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-09-08 21:59:57 +04:00
|
|
|
* 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
|
|
|
|
'
|
|
|
|
|
2010-08-18 03:00:34 +04:00
|
|
|
test_expect_success 'fmt-merge-msg -m' '
|
|
|
|
echo "Sync with left" >expected &&
|
|
|
|
cat >expected.log <<-EOF &&
|
|
|
|
Sync with left
|
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-08-18 03:00:34 +04:00
|
|
|
* ${apos}left${apos} of $(pwd):
|
|
|
|
Left #5
|
|
|
|
Left #4
|
|
|
|
Left #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
EOF
|
|
|
|
|
|
|
|
test_might_fail git config --unset merge.log &&
|
|
|
|
test_might_fail git config --unset merge.summary &&
|
|
|
|
git checkout master &&
|
|
|
|
git fetch "$(pwd)" left &&
|
|
|
|
git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
|
|
|
|
git fmt-merge-msg --log -m "Sync with left" \
|
|
|
|
<.git/FETCH_HEAD >actual.log &&
|
|
|
|
git config merge.log true &&
|
|
|
|
git fmt-merge-msg -m "Sync with left" \
|
|
|
|
<.git/FETCH_HEAD >actual.log-config &&
|
|
|
|
git fmt-merge-msg --no-log -m "Sync with left" \
|
|
|
|
<.git/FETCH_HEAD >actual.nolog &&
|
|
|
|
|
|
|
|
test_cmp expected actual &&
|
|
|
|
test_cmp expected.log actual.log &&
|
|
|
|
test_cmp expected.log actual.log-config &&
|
|
|
|
test_cmp expected actual.nolog
|
|
|
|
'
|
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_expect_success 'setup: expected shortlog for two branches' '
|
|
|
|
cat >expected <<-EOF
|
|
|
|
Merge branches ${apos}left${apos} and ${apos}right${apos}
|
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-08-17 10:57:40 +04:00
|
|
|
* left:
|
|
|
|
Left #5
|
|
|
|
Left #4
|
|
|
|
Left #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
|
|
|
|
* right:
|
|
|
|
Right #5
|
|
|
|
Right #4
|
|
|
|
Right #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
EOF
|
|
|
|
'
|
2008-04-06 05:23:45 +04:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_expect_success 'shortlog for two branches' '
|
2008-04-06 05:23:45 +04:00
|
|
|
git config merge.log true &&
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.summary &&
|
2008-04-06 05:23:45 +04:00
|
|
|
git checkout master &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2008-04-06 05:23:45 +04:00
|
|
|
git fetch . left right &&
|
2010-08-17 10:57:40 +04:00
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
|
2008-04-06 05:23:45 +04:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2007-01-29 03:16:53 +03:00
|
|
|
git config merge.summary true &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git checkout master &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git fetch . left right &&
|
2010-08-17 10:57:40 +04:00
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2008-04-06 05:23:45 +04:00
|
|
|
git config merge.log yes &&
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.summary &&
|
2008-04-06 05:23:45 +04:00
|
|
|
git checkout master &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2008-04-06 05:23:45 +04:00
|
|
|
git fetch . left right &&
|
2010-08-17 10:57:40 +04:00
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&
|
2008-04-06 05:23:45 +04:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2007-01-29 03:16:53 +03:00
|
|
|
git config merge.summary yes &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git checkout master &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2006-07-04 05:09:54 +04:00
|
|
|
git fetch . left right &&
|
2010-08-17 10:57:40 +04:00
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual4 &&
|
2006-07-04 05:09:54 +04:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_cmp expected actual1 &&
|
|
|
|
test_cmp expected actual2 &&
|
|
|
|
test_cmp expected actual3 &&
|
|
|
|
test_cmp expected actual4
|
2006-07-04 05:09:54 +04:00
|
|
|
'
|
|
|
|
|
2009-05-23 22:53:11 +04:00
|
|
|
test_expect_success 'merge-msg -F' '
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2009-05-23 22:53:11 +04:00
|
|
|
git config merge.summary yes &&
|
|
|
|
git checkout master &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2009-05-23 22:53:11 +04:00
|
|
|
git fetch . left right &&
|
|
|
|
git fmt-merge-msg -F .git/FETCH_HEAD >actual &&
|
|
|
|
test_cmp expected actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'merge-msg -F in subdirectory' '
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2009-05-23 22:53:11 +04:00
|
|
|
git config merge.summary yes &&
|
|
|
|
git checkout master &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2009-05-23 22:53:11 +04:00
|
|
|
git fetch . left right &&
|
|
|
|
mkdir sub &&
|
|
|
|
cp .git/FETCH_HEAD sub/FETCH_HEAD &&
|
|
|
|
(
|
|
|
|
cd sub &&
|
|
|
|
git fmt-merge-msg -F FETCH_HEAD >../actual
|
|
|
|
) &&
|
|
|
|
test_cmp expected actual
|
|
|
|
'
|
|
|
|
|
2010-03-24 10:15:58 +03:00
|
|
|
test_expect_success 'merge-msg with nothing to merge' '
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2010-03-24 10:15:58 +03:00
|
|
|
git config merge.summary yes &&
|
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
>empty &&
|
|
|
|
|
2010-03-24 10:15:58 +03:00
|
|
|
(
|
|
|
|
cd remote &&
|
|
|
|
git checkout -b unrelated &&
|
2010-03-24 10:15:59 +03:00
|
|
|
test_tick &&
|
2010-03-24 10:15:58 +03:00
|
|
|
git fetch origin &&
|
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >../actual
|
|
|
|
) &&
|
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_cmp empty actual
|
2010-03-24 10:15:58 +03:00
|
|
|
'
|
|
|
|
|
2010-03-24 10:16:00 +03:00
|
|
|
test_expect_success 'merge-msg tag' '
|
2010-08-17 10:57:40 +04:00
|
|
|
cat >expected <<-EOF &&
|
|
|
|
Merge tag ${apos}tag-r3${apos}
|
|
|
|
|
|
|
|
* tag ${apos}tag-r3${apos}:
|
|
|
|
Right #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
EOF
|
2010-03-24 10:16:00 +03:00
|
|
|
|
2010-08-17 10:57:40 +04:00
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2010-03-24 10:16:00 +03:00
|
|
|
git config merge.summary yes &&
|
|
|
|
|
|
|
|
git checkout master &&
|
|
|
|
test_tick &&
|
|
|
|
git fetch . tag tag-r3 &&
|
|
|
|
|
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
|
|
|
|
test_cmp expected actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'merge-msg two tags' '
|
2010-08-17 10:57:40 +04:00
|
|
|
cat >expected <<-EOF &&
|
|
|
|
Merge tags ${apos}tag-r3${apos} and ${apos}tag-l5${apos}
|
|
|
|
|
|
|
|
* tag ${apos}tag-r3${apos}:
|
|
|
|
Right #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-08-17 10:57:40 +04:00
|
|
|
* tag ${apos}tag-l5${apos}:
|
|
|
|
Left #5
|
|
|
|
Left #4
|
|
|
|
Left #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
EOF
|
|
|
|
|
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2010-03-24 10:16:00 +03:00
|
|
|
git config merge.summary yes &&
|
|
|
|
|
|
|
|
git checkout master &&
|
|
|
|
test_tick &&
|
|
|
|
git fetch . tag tag-r3 tag tag-l5 &&
|
|
|
|
|
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
|
|
|
|
test_cmp expected actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'merge-msg tag and branch' '
|
2010-08-17 10:57:40 +04:00
|
|
|
cat >expected <<-EOF &&
|
|
|
|
Merge branch ${apos}left${apos}, tag ${apos}tag-r3${apos}
|
|
|
|
|
|
|
|
* tag ${apos}tag-r3${apos}:
|
|
|
|
Right #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
|
2012-06-07 01:24:28 +04:00
|
|
|
# By Another Author (3) and A U Thor (2)
|
|
|
|
# Via Another Committer
|
2010-08-17 10:57:40 +04:00
|
|
|
* left:
|
|
|
|
Left #5
|
|
|
|
Left #4
|
|
|
|
Left #3
|
|
|
|
Common #2
|
|
|
|
Common #1
|
|
|
|
EOF
|
|
|
|
|
|
|
|
test_might_fail git config --unset-all merge.log &&
|
2010-03-24 10:16:00 +03:00
|
|
|
git config merge.summary yes &&
|
|
|
|
|
|
|
|
git checkout master &&
|
|
|
|
test_tick &&
|
|
|
|
git fetch . tag tag-r3 left &&
|
|
|
|
|
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
|
|
|
|
test_cmp expected actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'merge-msg lots of commits' '
|
2010-08-17 10:57:40 +04:00
|
|
|
{
|
|
|
|
cat <<-EOF &&
|
|
|
|
Merge branch ${apos}long${apos}
|
|
|
|
|
|
|
|
* long: (35 commits)
|
|
|
|
EOF
|
|
|
|
|
|
|
|
i=29 &&
|
|
|
|
while test $i -gt 9
|
|
|
|
do
|
|
|
|
echo " $i" &&
|
|
|
|
i=$(($i-1))
|
|
|
|
done &&
|
|
|
|
echo " ..."
|
|
|
|
} >expected &&
|
2010-03-24 10:16:00 +03:00
|
|
|
|
|
|
|
git checkout master &&
|
|
|
|
test_tick &&
|
|
|
|
git fetch . long &&
|
|
|
|
|
|
|
|
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
|
|
|
|
test_cmp expected actual
|
|
|
|
'
|
|
|
|
|
2006-07-04 05:09:54 +04:00
|
|
|
test_done
|