Skip to content

Commit

Permalink
fmt-merge-msg: stop treating master specially
Browse files Browse the repository at this point in the history
In the context of many projects renaming their primary branch names away
from `master`, Git wants to stop treating the `master` branch specially.

Let's start with `git fmt-merge-msg`.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
dscho authored and gitster committed Jun 24, 2020
1 parent 0313f36 commit 489947c
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 97 deletions.
5 changes: 1 addition & 4 deletions fmt-merge-msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,7 @@ static void fmt_merge_msg_title(struct strbuf *out,
strbuf_addf(out, " of %s", srcs.items[i].string);
}

if (!strcmp("master", current_branch))
strbuf_addch(out, '\n');
else
strbuf_addf(out, " into %s\n", current_branch);
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}" >expect &&
echo "Merge remote-tracking branch ${SQ}origin/side${SQ} into master" >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'
* [master] Merge branch 'side' into master
! [rearrange] Rearranged lines in dir/sub
! [side] Side
----
+ [rearrange] Rearranged lines in dir/sub
- [master] Merge branch 'side'
- [master] Merge branch 'side' into master
* + [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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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'
Merge branch 'side' into master

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

0 comments on commit 489947c

Please sign in to comment.