merge: notice local merging of tags and keep it unwrapped

This also updates the autogenerated merge title message from "merge commit X" to "merge tag X", and its effect can be seen in the changes to the test suite. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Nov 4, 2011 at 21:31 UTC 57b58db74c3272ac13d5d201ecedf6483b34cdfe
5 files changed +13 -8
builtin/merge.c
+5
@@ -441,6 +441,11 @@ static void merge_name(const char *remote, struct strbuf *msg)
441 sha1_to_hex(branch_head), remote);
442 goto cleanup;
443 }
444 + if (!prefixcmp(found_ref, "refs/tags/")) {
445 + strbuf_addf(msg, "%s\t\ttag '%s' of .\n",
446 + sha1_to_hex(branch_head), remote);
447 + goto cleanup;
448 + }
449 if (!prefixcmp(found_ref, "refs/remotes/")) {
450 strbuf_addf(msg, "%s\t\tremote-tracking branch '%s' of .\n",
451 sha1_to_hex(branch_head), remote);
t/t4202-log.sh
+2 -2
@@ -346,11 +346,11 @@ test_expect_success 'set up more tangled history' '
346 '
347
348 cat > expect <<\EOF
349 -* Merge commit 'reach'
349 +* Merge tag 'reach'
350 |\
351 | \
352 | \
353 -*-. \ Merge commit 'octopus-a'; commit 'octopus-b'
353 +*-. \ Merge tags 'octopus-a' and 'octopus-b'
354 |\ \ \
355 * | | | seventh
356 | | * | octopus-b
t/t7600-merge.sh
+3 -3
@@ -38,8 +38,8 @@ printf '%s\n' '1 X' 2 3 4 '5 X' 6 7 8 '9 X' >result.1-5-9
38 >empty
39
40 create_merge_msgs () {
41 - echo "Merge commit 'c2'" >msg.1-5 &&
42 - echo "Merge commit 'c2'; commit 'c3'" >msg.1-5-9 &&
41 + echo "Merge tag 'c2'" >msg.1-5 &&
42 + echo "Merge tags 'c2' and 'c3'" >msg.1-5-9 &&
43 {
44 echo "Squashed commit of the following:" &&
45 echo &&
@@ -57,7 +57,7 @@ create_merge_msgs () {
57 } >squash.1-5-9 &&
58 echo >msg.nolog &&
59 {
60 - echo "* commit 'c3':" &&
60 + echo "* tag 'c3':" &&
61 echo " commit 3" &&
62 echo
63 } >msg.log
t/t7604-merge-custom-message.sh
+1 -1
@@ -11,7 +11,7 @@ create_merge_msgs() {
11
12 cp exp.subject exp.log &&
13 echo >>exp.log "" &&
14 - echo >>exp.log "* commit 'c2':" &&
14 + echo >>exp.log "* tag 'c2':" &&
15 echo >>exp.log " c2"
16 }
17
t/t7608-merge-messages.sh
+2 -2
@@ -35,7 +35,7 @@ test_expect_success 'merge tag' '
35 git checkout master &&
36 test_commit master-3 &&
37 git merge tag-1 &&
38 - check_oneline "Merge commit Qtag-1Q"
38 + check_oneline "Merge tag Qtag-1Q"
39 '
40
41 test_expect_success 'ambiguous tag' '
@@ -44,7 +44,7 @@ test_expect_success 'ambiguous tag' '
44 git checkout master &&
45 test_commit master-4 &&
46 git merge ambiguous &&
47 - check_oneline "Merge commit QambiguousQ"
47 + check_oneline "Merge tag QambiguousQ"
48 '
49
50 test_expect_success 'remote-tracking branch' '