Merge branch 'jc/fmt-merge-msg-suppress-destination' into master
"git merge" learned to selectively omit " into <branch>" at the end
of the title of default merge message with merge.suppressDest
configuration.
* jc/fmt-merge-msg-suppress-destination:
fmt-merge-msg: allow merge destination to be omitted again
Revert "fmt-merge-msg: stop treating `master` specially"
diff --git a/Documentation/config/fmt-merge-msg.txt b/Documentation/config/fmt-merge-msg.txt
index c73cfa9..a8e8f74 100644
--- a/Documentation/config/fmt-merge-msg.txt
+++ b/Documentation/config/fmt-merge-msg.txt
@@ -8,3 +8,15 @@
most the specified number of one-line descriptions from the
actual commits that are being merged. Defaults to false, and
true is a synonym for 20.
+
+merge.suppressDest::
+ By adding a glob that matches the names of integration
+ branches to this multi-valued configuration variable, the
+ default merge message computed for merges into these
+ integration branches will omit " into <branch name>" from
+ its title.
++
+An element with an empty value can be used to clear the list
+of globs accumulated from previous configuration entries.
+When there is no `merge.suppressDest` variable defined, the
+default value of `master` is used for backward compatibility.
diff --git a/fmt-merge-msg.c b/fmt-merge-msg.c
index cfb8ff2..bd22e1e 100644
--- a/fmt-merge-msg.c
+++ b/fmt-merge-msg.c
@@ -10,6 +10,8 @@
#include "commit-reach.h"
static int use_branch_desc;
+static int suppress_dest_pattern_seen;
+static struct string_list suppress_dest_patterns = STRING_LIST_INIT_DUP;
int fmt_merge_msg_config(const char *key, const char *value, void *cb)
{
@@ -22,6 +24,14 @@
merge_log_config = DEFAULT_MERGE_LOG_LEN;
} else if (!strcmp(key, "merge.branchdesc")) {
use_branch_desc = git_config_bool(key, value);
+ } else if (!strcmp(key, "merge.suppressdest")) {
+ if (!value)
+ return config_error_nonbool(key);
+ if (!*value)
+ string_list_clear(&suppress_dest_patterns, 0);
+ else
+ string_list_append(&suppress_dest_patterns, value);
+ suppress_dest_pattern_seen = 1;
} else {
return git_default_config(key, value, cb);
}
@@ -403,6 +413,24 @@
string_list_clear(&subjects, 0);
}
+/*
+ * See if dest_branch matches with any glob pattern on the
+ * suppress_dest_patterns list.
+ *
+ * We may want to also allow negative matches e.g. ":!glob" like we do
+ * for pathspec, but for now, let's keep it simple and stupid.
+ */
+static int dest_suppressed(const char *dest_branch)
+{
+ struct string_list_item *item;
+
+ for_each_string_list_item(item, &suppress_dest_patterns) {
+ if (!wildmatch(item->string, dest_branch, WM_PATHNAME))
+ return 1;
+ }
+ return 0;
+}
+
static void fmt_merge_msg_title(struct strbuf *out,
const char *current_branch)
{
@@ -451,7 +479,9 @@
strbuf_addf(out, " of %s", srcs.items[i].string);
}
- strbuf_addf(out, " into %s\n", current_branch);
+ if (!dest_suppressed(current_branch))
+ strbuf_addf(out, " into %s", current_branch);
+ strbuf_addch(out, '\n');
}
static void fmt_tag_signature(struct strbuf *tagbuf,
@@ -596,6 +626,9 @@
void *current_branch_to_free;
struct merge_parents merge_parents;
+ if (!suppress_dest_pattern_seen)
+ string_list_append(&suppress_dest_patterns, "master");
+
memset(&merge_parents, 0, sizeof(merge_parents));
/* get current branch */
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
index f213aa8..dfc0d96 100755
--- a/t/t1507-rev-parse-upstream.sh
+++ b/t/t1507-rev-parse-upstream.sh
@@ -137,7 +137,7 @@
git branch -t new my-side@{u} &&
git merge -s ours new@{u} &&
git show -s --pretty=tformat:%s >actual &&
- echo "Merge remote-tracking branch ${SQ}origin/side${SQ} into master" >expect &&
+ echo "Merge remote-tracking branch ${SQ}origin/side${SQ}" >expect &&
test_cmp expect actual
)
'
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 43267d6..3f60f7d 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -117,12 +117,12 @@
: <<\EOF
! [initial] Initial
- * [master] Merge branch 'side' into master
+ * [master] Merge branch 'side'
! [rearrange] Rearranged lines in dir/sub
! [side] Side
----
+ [rearrange] Rearranged lines in dir/sub
- - [master] Merge branch 'side' into master
+ - [master] Merge branch 'side'
* + [side] Side
* [master^] Third
* [master~2] Second
diff --git a/t/t4013/diff.log_--decorate=full_--all b/t/t4013/diff.log_--decorate=full_--all
index c56783b..3f9b872 100644
--- a/t/t4013/diff.log_--decorate=full_--all
+++ b/t/t4013/diff.log_--decorate=full_--all
@@ -31,7 +31,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (refs/heads/side)
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_--decorate_--all b/t/t4013/diff.log_--decorate_--all
index 1cbdc03..f5e20e1 100644
--- a/t/t4013/diff.log_--decorate_--all
+++ b/t/t4013/diff.log_--decorate_--all
@@ -31,7 +31,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (side)
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_ b/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_
index f5b1b65..a18f147 100644
--- a/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_
+++ b/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_--patch-with-stat_master b/t/t4013/diff.log_--patch-with-stat_master
index af23803..ae425c4 100644
--- a/t/t4013/diff.log_--patch-with-stat_master
+++ b/t/t4013/diff.log_--patch-with-stat_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_--patch-with-stat_master_--_dir_ b/t/t4013/diff.log_--patch-with-stat_master_--_dir_
index 814098f..d5207ca 100644
--- a/t/t4013/diff.log_--patch-with-stat_master_--_dir_
+++ b/t/t4013/diff.log_--patch-with-stat_master_--_dir_
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master
index b927fe4..0fc1e8c 100644
--- a/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master
+++ b/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
dir/sub | 2 ++
file0 | 3 +++
diff --git a/t/t4013/diff.log_--root_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_--patch-with-stat_--summary_master
index 6db3cea..dffc09d 100644
--- a/t/t4013/diff.log_--root_--patch-with-stat_--summary_master
+++ b/t/t4013/diff.log_--root_--patch-with-stat_--summary_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_--root_--patch-with-stat_master b/t/t4013/diff.log_--root_--patch-with-stat_master
index 98e9c32..55aa980 100644
--- a/t/t4013/diff.log_--root_--patch-with-stat_master
+++ b/t/t4013/diff.log_--root_--patch-with-stat_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master
index b61b111..019d85f 100644
--- a/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master
+++ b/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
dir/sub | 2 ++
file0 | 3 +++
diff --git a/t/t4013/diff.log_--root_-p_master b/t/t4013/diff.log_--root_-p_master
index 345bd9e..b42c334 100644
--- a/t/t4013/diff.log_--root_-p_master
+++ b/t/t4013/diff.log_--root_-p_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_--root_master b/t/t4013/diff.log_--root_master
index db56b1f..e8f4615 100644
--- a/t/t4013/diff.log_--root_master
+++ b/t/t4013/diff.log_--root_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_-m_-p_--first-parent_master b/t/t4013/diff.log_-m_-p_--first-parent_master
index bcadb50..7a0073f 100644
--- a/t/t4013/diff.log_-m_-p_--first-parent_master
+++ b/t/t4013/diff.log_-m_-p_--first-parent_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
diff --git a/dir/sub b/dir/sub
index cead32e..992913c 100644
diff --git a/t/t4013/diff.log_-m_-p_master b/t/t4013/diff.log_-m_-p_master
index 2acf43a..9ca62a0 100644
--- a/t/t4013/diff.log_-m_-p_master
+++ b/t/t4013/diff.log_-m_-p_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
diff --git a/dir/sub b/dir/sub
index cead32e..992913c 100644
@@ -33,7 +33,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
diff --git a/dir/sub b/dir/sub
index 7289e35..992913c 100644
diff --git a/t/t4013/diff.log_-p_--first-parent_master b/t/t4013/diff.log_-p_--first-parent_master
index c6a5876..3fc896d 100644
--- a/t/t4013/diff.log_-p_--first-parent_master
+++ b/t/t4013/diff.log_-p_--first-parent_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_-p_master b/t/t4013/diff.log_-p_master
index 1841cde..bf1326d 100644
--- a/t/t4013/diff.log_-p_master
+++ b/t/t4013/diff.log_-p_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.log_master b/t/t4013/diff.log_master
index f8ec445..a8f6ce5 100644
--- a/t/t4013/diff.log_master
+++ b/t/t4013/diff.log_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <author@example.com>
diff --git a/t/t4013/diff.show_--first-parent_master b/t/t4013/diff.show_--first-parent_master
index 94548f4..3dcbe47 100644
--- a/t/t4013/diff.show_--first-parent_master
+++ b/t/t4013/diff.show_--first-parent_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
diff --git a/dir/sub b/dir/sub
index cead32e..992913c 100644
diff --git a/t/t4013/diff.show_-c_master b/t/t4013/diff.show_-c_master
index 1c46ed6..81aba8d 100644
--- a/t/t4013/diff.show_-c_master
+++ b/t/t4013/diff.show_-c_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
diff --combined dir/sub
index cead32e,7289e35..992913c
diff --git a/t/t4013/diff.show_-m_master b/t/t4013/diff.show_-m_master
index 7559fc2..4ea2ee4 100644
--- a/t/t4013/diff.show_-m_master
+++ b/t/t4013/diff.show_-m_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
diff --git a/dir/sub b/dir/sub
index cead32e..992913c 100644
@@ -33,7 +33,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
diff --git a/dir/sub b/dir/sub
index 7289e35..992913c 100644
diff --git a/t/t4013/diff.show_master b/t/t4013/diff.show_master
index 57091c5..fb08ce0 100644
--- a/t/t4013/diff.show_master
+++ b/t/t4013/diff.show_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
diff --cc dir/sub
index cead32e,7289e35..992913c
diff --git a/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master b/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master
index 5f13a71..30aae78 100644
--- a/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master
+++ b/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
dir/sub | 2 ++
file0 | 3 +++
diff --git a/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master b/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master
index 8acb882..d1d32bd 100644
--- a/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master
+++ b/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master
@@ -4,7 +4,7 @@
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000
- Merge branch 'side' into master
+ Merge branch 'side'
dir/sub | 2 ++
file0 | 3 +++
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index fd9af65..a093059 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -483,7 +483,7 @@
'
cat > expect <<\EOF
-* Merge branch 'side' into master
+* Merge branch 'side'
|\
| * side-2
| * side-1
@@ -502,7 +502,7 @@
'
cat > expect <<\EOF
-| | | * Merge branch 'side' into master
+| | | * Merge branch 'side'
| | | |\
| | | | * side-2
| | | | * side-1
@@ -521,7 +521,7 @@
'
cat > expect.colors <<\EOF
-* Merge branch 'side' into master
+* Merge branch 'side'
<BLUE>|<RESET><CYAN>\<RESET>
<BLUE>|<RESET> * side-2
<BLUE>|<RESET> * side-1
@@ -555,7 +555,7 @@
|\ Merge: A B
| | Author: A U Thor <author@example.com>
| |
-| | Merge branch 'side' into master
+| | Merge branch 'side'
| |
| * commit tags/side-2
| | Author: A U Thor <author@example.com>
@@ -632,11 +632,11 @@
'
cat > expect <<\EOF
-* Merge tag 'reach' into master
+* Merge tag 'reach'
|\
| \
| \
-*-. \ Merge tags 'octopus-a' and 'octopus-b' into master
+*-. \ Merge tags 'octopus-a' and 'octopus-b'
|\ \ \
* | | | seventh
| | * | octopus-b
@@ -646,14 +646,14 @@
|/ /
| * reach
|/
-* Merge branch 'tangle' into master
+* Merge branch 'tangle'
|\
| * Merge branch 'side' (early part) into tangle
| |\
| * \ Merge branch 'master' (early part) into tangle
| |\ \
| * | | tangle-a
-* | | | Merge branch 'side' into master
+* | | | Merge branch 'side'
|\ \ \ \
| * | | | side-2
| | |_|/
@@ -735,16 +735,16 @@
test_expect_success 'decorate-refs with glob' '
cat >expect.decorate <<-\EOF &&
- Merge-tag-reach-into-master
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach
+ Merge-tags-octopus-a-and-octopus-b
seventh
octopus-b (octopus-b)
octopus-a (octopus-a)
reach
EOF
cat >expect.no-decorate <<-\EOF &&
- Merge-tag-reach-into-master
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach
+ Merge-tags-octopus-a-and-octopus-b
seventh
octopus-b
octopus-a
@@ -765,8 +765,8 @@
test_expect_success 'decorate-refs without globs' '
cat >expect.decorate <<-\EOF &&
- Merge-tag-reach-into-master
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach
+ Merge-tags-octopus-a-and-octopus-b
seventh
octopus-b
octopus-a
@@ -779,8 +779,8 @@
test_expect_success 'multiple decorate-refs' '
cat >expect.decorate <<-\EOF &&
- Merge-tag-reach-into-master
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach
+ Merge-tags-octopus-a-and-octopus-b
seventh
octopus-b (octopus-b)
octopus-a (octopus-a)
@@ -794,8 +794,8 @@
test_expect_success 'decorate-refs-exclude with glob' '
cat >expect.decorate <<-\EOF &&
- Merge-tag-reach-into-master (HEAD -> master)
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach (HEAD -> master)
+ Merge-tags-octopus-a-and-octopus-b
seventh (tag: seventh)
octopus-b (tag: octopus-b)
octopus-a (tag: octopus-a)
@@ -811,8 +811,8 @@
test_expect_success 'decorate-refs-exclude without globs' '
cat >expect.decorate <<-\EOF &&
- Merge-tag-reach-into-master (HEAD -> master)
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach (HEAD -> master)
+ Merge-tags-octopus-a-and-octopus-b
seventh (tag: seventh)
octopus-b (tag: octopus-b, octopus-b)
octopus-a (tag: octopus-a, octopus-a)
@@ -828,8 +828,8 @@
test_expect_success 'multiple decorate-refs-exclude' '
cat >expect.decorate <<-\EOF &&
- Merge-tag-reach-into-master (HEAD -> master)
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach (HEAD -> master)
+ Merge-tags-octopus-a-and-octopus-b
seventh (tag: seventh)
octopus-b (tag: octopus-b)
octopus-a (tag: octopus-a)
@@ -851,8 +851,8 @@
test_expect_success 'decorate-refs and decorate-refs-exclude' '
cat >expect.no-decorate <<-\EOF &&
- Merge-tag-reach-into-master (master)
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach (master)
+ Merge-tags-octopus-a-and-octopus-b
seventh
octopus-b
octopus-a
@@ -866,8 +866,8 @@
test_expect_success 'deocrate-refs and log.excludeDecoration' '
cat >expect.decorate <<-\EOF &&
- Merge-tag-reach-into-master (master)
- Merge-tags-octopus-a-and-octopus-b-into-master
+ Merge-tag-reach (master)
+ Merge-tags-octopus-a-and-octopus-b
seventh
octopus-b (octopus-b)
octopus-a (octopus-a)
@@ -881,10 +881,10 @@
test_expect_success 'decorate-refs-exclude and simplify-by-decoration' '
cat >expect.decorate <<-\EOF &&
- Merge-tag-reach-into-master (HEAD -> master)
+ Merge-tag-reach (HEAD -> master)
reach (tag: reach, reach)
seventh (tag: seventh)
- Merge-branch-tangle-into-master
+ Merge-branch-tangle
Merge-branch-side-early-part-into-tangle (tangle)
tangle-a (tag: tangle-a)
EOF
@@ -1068,7 +1068,7 @@
|\ Merge: MERGE_PARENTS
| | Author: A U Thor <author@example.com>
| |
-| | Merge branch 'tangle' into master
+| | Merge branch 'tangle'
| |
| * commit COMMIT_OBJECT_NAME
| |\ Merge: MERGE_PARENTS
@@ -1102,7 +1102,7 @@
|\ \ \ \ Merge: MERGE_PARENTS
| | | | | Author: A U Thor <author@example.com>
| | | | |
-| | | | | Merge branch 'side' into master
+| | | | | Merge branch 'side'
| | | | |
| * | | | commit COMMIT_OBJECT_NAME
| | |_|/ Author: A U Thor <author@example.com>
@@ -1343,7 +1343,7 @@
*** |\ Merge: MERGE_PARENTS
*** | | Author: A U Thor <author@example.com>
*** | |
-*** | | Merge branch 'tangle' into master
+*** | | Merge branch 'tangle'
*** | |
*** | * commit COMMIT_OBJECT_NAME
*** | |\ Merge: MERGE_PARENTS
@@ -1377,7 +1377,7 @@
*** |\ \ \ \ Merge: MERGE_PARENTS
*** | | | | | Author: A U Thor <author@example.com>
*** | | | | |
-*** | | | | | Merge branch 'side' into master
+*** | | | | | Merge branch 'side'
*** | | | | |
*** | * | | | commit COMMIT_OBJECT_NAME
*** | | |_|/ Author: A U Thor <author@example.com>
@@ -1540,8 +1540,8 @@
* reach
|
| A reach.t
-* Merge branch 'tangle' into master
-* Merge branch 'side' into master
+* Merge branch 'tangle'
+* Merge branch 'side'
|\
| * side-2
|
@@ -1562,8 +1562,8 @@
* reach
|
| reach.t
-* Merge branch 'tangle' into master
-* Merge branch 'side' into master
+* Merge branch 'tangle'
+* Merge branch 'side'
|\
| * side-2
|
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 2b3fd49..7d54974 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -79,7 +79,7 @@
'
test_expect_success 'message for merging local branch' '
- echo "Merge branch ${apos}left${apos} into master" >expected &&
+ echo "Merge branch ${apos}left${apos}" >expected &&
git checkout master &&
git fetch . left &&
@@ -107,7 +107,7 @@
'
test_expect_success 'message for merging external branch' '
- echo "Merge branch ${apos}left${apos} of $(pwd) into master" >expected &&
+ echo "Merge branch ${apos}left${apos} of $(pwd)" >expected &&
git checkout master &&
git fetch "$(pwd)" left &&
@@ -118,7 +118,7 @@
test_expect_success '[merge] summary/log configuration' '
cat >expected <<-EOF &&
- Merge branch ${apos}left${apos} into master
+ Merge branch ${apos}left${apos}
# By Another Author (3) and A U Thor (2)
# Via Another Committer
@@ -160,7 +160,7 @@
test_expect_success 'merge.log=3 limits shortlog length' '
cat >expected <<-EOF &&
- Merge branch ${apos}left${apos} into master
+ Merge branch ${apos}left${apos}
# By Another Author (3) and A U Thor (2)
# Via Another Committer
@@ -177,7 +177,7 @@
test_expect_success 'merge.log=5 shows all 5 commits' '
cat >expected <<-EOF &&
- Merge branch ${apos}left${apos} into master
+ Merge branch ${apos}left${apos}
# By Another Author (3) and A U Thor (2)
# Via Another Committer
@@ -195,7 +195,7 @@
test_expect_success '--log=5 with custom comment character' '
cat >expected <<-EOF &&
- Merge branch ${apos}left${apos} into master
+ Merge branch ${apos}left${apos}
x By Another Author (3) and A U Thor (2)
x Via Another Committer
@@ -212,14 +212,14 @@
'
test_expect_success 'merge.log=0 disables shortlog' '
- echo "Merge branch ${apos}left${apos} into master" >expected &&
+ 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 '--log=3 limits shortlog length' '
cat >expected <<-EOF &&
- Merge branch ${apos}left${apos} into master
+ Merge branch ${apos}left${apos}
# By Another Author (3) and A U Thor (2)
# Via Another Committer
@@ -236,7 +236,7 @@
test_expect_success '--log=5 shows all 5 commits' '
cat >expected <<-EOF &&
- Merge branch ${apos}left${apos} into master
+ Merge branch ${apos}left${apos}
# By Another Author (3) and A U Thor (2)
# Via Another Committer
@@ -253,13 +253,13 @@
'
test_expect_success '--no-log disables shortlog' '
- echo "Merge branch ${apos}left${apos} into master" >expected &&
+ 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} into master" >expected &&
+ echo "Merge branch ${apos}left${apos}" >expected &&
git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual &&
test_cmp expected actual
'
@@ -300,7 +300,7 @@
test_expect_success 'setup: expected shortlog for two branches' '
cat >expected <<-EOF
- Merge branches ${apos}left${apos} and ${apos}right${apos} into master
+ Merge branches ${apos}left${apos} and ${apos}right${apos}
# By Another Author (3) and A U Thor (2)
# Via Another Committer
@@ -397,7 +397,7 @@
test_expect_success 'merge-msg tag' '
cat >expected <<-EOF &&
- Merge tag ${apos}tag-r3${apos} into master
+ Merge tag ${apos}tag-r3${apos}
* tag ${apos}tag-r3${apos}:
Right #3
@@ -418,7 +418,7 @@
test_expect_success 'merge-msg two tags' '
cat >expected <<-EOF &&
- Merge tags ${apos}tag-r3${apos} and ${apos}tag-l5${apos} into master
+ Merge tags ${apos}tag-r3${apos} and ${apos}tag-l5${apos}
* tag ${apos}tag-r3${apos}:
Right #3
@@ -448,7 +448,7 @@
test_expect_success 'merge-msg tag and branch' '
cat >expected <<-EOF &&
- Merge branch ${apos}left${apos}, tag ${apos}tag-r3${apos} into master
+ Merge branch ${apos}left${apos}, tag ${apos}tag-r3${apos}
* tag ${apos}tag-r3${apos}:
Right #3
@@ -479,7 +479,7 @@
test_expect_success 'merge-msg lots of commits' '
{
cat <<-EOF &&
- Merge branch ${apos}long${apos} into master
+ Merge branch ${apos}long${apos}
* long: (35 commits)
EOF
@@ -516,7 +516,7 @@
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
{
cat <<-\EOF
- Merge tag '\''annote'\'' into master
+ Merge tag '\''annote'\''
An annotated one
@@ -531,7 +531,7 @@
git merge --no-commit --no-ff $annote &&
{
cat <<-EOF
- Merge tag '\''$annote'\'' into master
+ Merge tag '\''$annote'\''
An annotated one
@@ -542,4 +542,24 @@
test_cmp expected .git/MERGE_MSG
'
+test_expect_success 'merge.suppressDest configuration' '
+ git checkout -B side master &&
+ git commit --allow-empty -m "One step ahead" &&
+ git checkout master &&
+ git fetch . side &&
+
+ git -c merge.suppressDest="" fmt-merge-msg <.git/FETCH_HEAD >full.1 &&
+ head -n1 full.1 >actual &&
+ grep -e "Merge branch .side. into master" actual &&
+
+ git -c merge.suppressDest="mast" fmt-merge-msg <.git/FETCH_HEAD >full.2 &&
+ head -n1 full.2 >actual &&
+ grep -e "Merge branch .side. into master$" actual &&
+
+ git -c merge.suppressDest="ma??er" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
+ head -n1 full.3 >actual &&
+ grep -e "Merge branch .side." actual &&
+ ! grep -e " into master$" actual
+'
+
test_done
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 1d45f9a..5883a6a 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -14,9 +14,9 @@
! [c4] c4
! [c5] c5
! [c6] c6
- * [master] Merge commit 'c1' into master
+ * [master] Merge commit 'c1'
--------
- - [master] Merge commit 'c1' into master
+ - [master] Merge commit 'c1'
+ * [c1] commit 1
+ [c6] c6
+ [c5] c5
@@ -44,8 +44,8 @@
test_write_lines 1 2 3 4 5 6 7 8 '9 Z' >result.9z
create_merge_msgs () {
- echo "Merge tag 'c2' into master" >msg.1-5 &&
- echo "Merge tags 'c2' and 'c3' into master" >msg.1-5-9 &&
+ echo "Merge tag 'c2'" >msg.1-5 &&
+ echo "Merge tags 'c2' and 'c3'" >msg.1-5-9 &&
{
echo "Squashed commit of the following:" &&
echo &&
@@ -258,7 +258,7 @@
git commit --no-edit -a &&
cat >expect <<-\EOF &&
- Merge tag '"'"'c7'"'"' into master
+ Merge tag '"'"'c7'"'"'
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
@@ -808,10 +808,10 @@
'
cat >expected.branch <<\EOF
-Merge branch 'c5-branch' (early part) into master
+Merge branch 'c5-branch' (early part)
EOF
cat >expected.tag <<\EOF
-Merge commit 'c5~1' into master
+Merge commit 'c5~1'
EOF
test_expect_success 'merge early part of c2' '
diff --git a/t/t7608-merge-messages.sh b/t/t7608-merge-messages.sh
index 2af33f1..8e7e0a5 100755
--- a/t/t7608-merge-messages.sh
+++ b/t/t7608-merge-messages.sh
@@ -16,7 +16,7 @@
git checkout master &&
test_commit master-2 &&
git merge local-branch &&
- check_oneline "Merge branch Qlocal-branchQ into master"
+ check_oneline "Merge branch Qlocal-branchQ"
'
test_expect_success 'merge octopus branches' '
@@ -26,7 +26,7 @@
test_commit octopus-2 &&
git checkout master &&
git merge octopus-a octopus-b &&
- check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ into master"
+ check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ"
'
test_expect_success 'merge tag' '
@@ -35,7 +35,7 @@
git checkout master &&
test_commit master-3 &&
git merge tag-1 &&
- check_oneline "Merge tag Qtag-1Q into master"
+ check_oneline "Merge tag Qtag-1Q"
'
test_expect_success 'ambiguous tag' '
@@ -44,7 +44,7 @@
git checkout master &&
test_commit master-4 &&
git merge ambiguous &&
- check_oneline "Merge tag QambiguousQ into master"
+ check_oneline "Merge tag QambiguousQ"
'
test_expect_success 'remote-tracking branch' '
@@ -54,7 +54,7 @@
git checkout master &&
test_commit master-5 &&
git merge origin/master &&
- check_oneline "Merge remote-tracking branch Qorigin/masterQ into master"
+ check_oneline "Merge remote-tracking branch Qorigin/masterQ"
'
test_done