Skip to content

Commit

Permalink
Revert "fmt-merge-msg: stop treating master specially"
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gitster committed Jul 30, 2020
1 parent 489947c commit 2153192
Show file tree
Hide file tree
Showing 29 changed files with 97 additions and 94 deletions.
5 changes: 4 additions & 1 deletion fmt-merge-msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,10 @@ static void fmt_merge_msg_title(struct strbuf *out,
strbuf_addf(out, " of %s", srcs.items[i].string);
}

strbuf_addf(out, " into %s\n", current_branch);
if (!strcmp("master", current_branch))
strbuf_addch(out, '\n');
else
strbuf_addf(out, " into %s\n", current_branch);
}

static void fmt_tag_signature(struct strbuf *tagbuf,
Expand Down
2 changes: 1 addition & 1 deletion t/t1507-rev-parse-upstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ test_expect_success 'merge my-side@{u} records the correct name' '
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
)
'
Expand Down
4 changes: 2 additions & 2 deletions t/t4013-diff-various.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ test_expect_success setup '

: <<\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
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_--decorate=full_--all
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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 <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_--decorate_--all
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a (side)
Author: A U Thor <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_--patch-with-stat_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_--patch-with-stat_master_--_dir_
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

dir/sub | 2 ++
file0 | 3 +++
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_--root_--patch-with-stat_--summary_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_--root_--patch-with-stat_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

dir/sub | 2 ++
file0 | 3 +++
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_--root_-p_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_--root_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_-m_-p_--first-parent_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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
Expand Down
4 changes: 2 additions & 2 deletions t/t4013/diff.log_-m_-p_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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
Expand Down Expand Up @@ -33,7 +33,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_-p_--first-parent_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
Author: A U Thor <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_-p_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.log_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
Author: A U Thor <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.show_--first-parent_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.show_-c_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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
Expand Down
4 changes: 2 additions & 2 deletions t/t4013/diff.show_-m_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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
Expand Down Expand Up @@ -33,7 +33,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.show_master
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

dir/sub | 2 ++
file0 | 3 +++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Merge: 9a6d494 c7a2ab9
Author: A U Thor <[email protected]>
Date: Mon Jun 26 00:04:00 2006 +0000

Merge branch 'side' into master
Merge branch 'side'

dir/sub | 2 ++
file0 | 3 +++
Expand Down
Loading

0 comments on commit 2153192

Please sign in to comment.