Skip to content

Commit 2153192

Browse files
committed
Revert "fmt-merge-msg: stop treating master specially"
This reverts commit 489947c, which stopped treating merges into the 'master' branch as special when preparing the default merge message. As the goal was not to have any single branch designated as special, it solved it by leaving the "into <branchname>" at the end of the title of the default merge message for any and all branches. An obvious and easy alternative to treat everybody equally could have been to remove it for every branch, but that involves loss of information. We'll introduce a new mechanism to let end-users specify merges into which branches would omit the "into <branchname>" from the title of the default merge message, and make the mechanism, when unconfigured, treat the traditional 'master' special again, so all the changes to the tests we made earlier will become unnecessary, as these tests will be run without configuring the said new mechanism. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 489947c commit 2153192

29 files changed

+97
-94
lines changed

fmt-merge-msg.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,10 @@ static void fmt_merge_msg_title(struct strbuf *out,
451451
strbuf_addf(out, " of %s", srcs.items[i].string);
452452
}
453453

454-
strbuf_addf(out, " into %s\n", current_branch);
454+
if (!strcmp("master", current_branch))
455+
strbuf_addch(out, '\n');
456+
else
457+
strbuf_addf(out, " into %s\n", current_branch);
455458
}
456459

457460
static void fmt_tag_signature(struct strbuf *tagbuf,

t/t1507-rev-parse-upstream.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ test_expect_success 'merge my-side@{u} records the correct name' '
137137
git branch -t new my-side@{u} &&
138138
git merge -s ours new@{u} &&
139139
git show -s --pretty=tformat:%s >actual &&
140-
echo "Merge remote-tracking branch ${SQ}origin/side${SQ} into master" >expect &&
140+
echo "Merge remote-tracking branch ${SQ}origin/side${SQ}" >expect &&
141141
test_cmp expect actual
142142
)
143143
'

t/t4013-diff-various.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ test_expect_success setup '
117117

118118
: <<\EOF
119119
! [initial] Initial
120-
* [master] Merge branch 'side' into master
120+
* [master] Merge branch 'side'
121121
! [rearrange] Rearranged lines in dir/sub
122122
! [side] Side
123123
----
124124
+ [rearrange] Rearranged lines in dir/sub
125-
- [master] Merge branch 'side' into master
125+
- [master] Merge branch 'side'
126126
* + [side] Side
127127
* [master^] Third
128128
* [master~2] Second

t/t4013/diff.log_--decorate=full_--all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Merge: 9a6d494 c7a2ab9
3131
Author: A U Thor <[email protected]>
3232
Date: Mon Jun 26 00:04:00 2006 +0000
3333

34-
Merge branch 'side' into master
34+
Merge branch 'side'
3535

3636
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (refs/heads/side)
3737
Author: A U Thor <[email protected]>

t/t4013/diff.log_--decorate_--all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Merge: 9a6d494 c7a2ab9
3131
Author: A U Thor <[email protected]>
3232
Date: Mon Jun 26 00:04:00 2006 +0000
3333

34-
Merge branch 'side' into master
34+
Merge branch 'side'
3535

3636
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (side)
3737
Author: A U Thor <[email protected]>

t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_--patch-with-stat_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_--patch-with-stat_master_--_dir_

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
dir/sub | 2 ++
1010
file0 | 3 +++

t/t4013/diff.log_--root_--patch-with-stat_--summary_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_--root_--patch-with-stat_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
dir/sub | 2 ++
1010
file0 | 3 +++

t/t4013/diff.log_--root_-p_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_--root_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_-m_-p_--first-parent_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
diff --git a/dir/sub b/dir/sub
1010
index cead32e..992913c 100644

t/t4013/diff.log_-m_-p_master

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
diff --git a/dir/sub b/dir/sub
1010
index cead32e..992913c 100644
@@ -33,7 +33,7 @@ Merge: 9a6d494 c7a2ab9
3333
Author: A U Thor <[email protected]>
3434
Date: Mon Jun 26 00:04:00 2006 +0000
3535

36-
Merge branch 'side' into master
36+
Merge branch 'side'
3737

3838
diff --git a/dir/sub b/dir/sub
3939
index 7289e35..992913c 100644

t/t4013/diff.log_-p_--first-parent_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_-p_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.log_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
1010
Author: A U Thor <[email protected]>

t/t4013/diff.show_--first-parent_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
diff --git a/dir/sub b/dir/sub
1010
index cead32e..992913c 100644

t/t4013/diff.show_-c_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
diff --combined dir/sub
1010
index cead32e,7289e35..992913c

t/t4013/diff.show_-m_master

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
diff --git a/dir/sub b/dir/sub
1010
index cead32e..992913c 100644
@@ -33,7 +33,7 @@ Merge: 9a6d494 c7a2ab9
3333
Author: A U Thor <[email protected]>
3434
Date: Mon Jun 26 00:04:00 2006 +0000
3535

36-
Merge branch 'side' into master
36+
Merge branch 'side'
3737

3838
diff --git a/dir/sub b/dir/sub
3939
index 7289e35..992913c 100644

t/t4013/diff.show_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
diff --cc dir/sub
1010
index cead32e,7289e35..992913c

t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
dir/sub | 2 ++
1010
file0 | 3 +++

t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
44
Author: A U Thor <[email protected]>
55
Date: Mon Jun 26 00:04:00 2006 +0000
66

7-
Merge branch 'side' into master
7+
Merge branch 'side'
88

99
dir/sub | 2 ++
1010
file0 | 3 +++

0 commit comments

Comments
 (0)