Skip to contentSkip to conversation

Prepare for changing the default branch name main (last manual part)

PATCH Superseded Johannes Schindelin via GitGitGadget 3 participants 35 messages Oct 19, 2020 – Oct 23, 2020

lore
Share & tools
lore
#0 lore raw

cover Prepare for changing the default branch name main (last manual part)

In preparation for changing the default of init.defaultBranch to main, here are a couple of manual adjustments that cannot be automated (i.e., these adjustments are not mere search-and-replaces).

This patch series is based on js/default-branch-name-part-3, and is part of the larger effort tracked at https://github.com/gitgitgadget/git/pull/655.

The next patch series will be largely automated search-and-replaces; Obviously, the search-and-replace was the easy part, the manual inspection whether the changes are actually correct was much more involved.

What to expect next, after this patch series? Essentially, there is the large patch series that adjusts the entire test suite, with two patch series extracted from that effort: t5411 and t5515 simply require too large patches, and will therefore be presented as the next patch series after this one.

Johannes Schindelin (10):
fmt-merge-msg: also suppress "into main" by default
t9801: use -- in preparation for default branch rename
tests: start moving to a different default main branch name
t4013: prepare for the new default branch name "main"
t6200: adjust suppression pattern to also match "main"
t5703: adjust a test case for the upcoming default branch name
t3200: prepare for main being shorter than master
t9902: prepare a test for the upcoming default branch name
tests: prepare aligned mentions of the default branch name
t1400: prepare for main being default branch name

 fmt-merge-msg.c                               |   4 +-
 refs.c                                        |   5 +-
 t/lib-submodule-update.sh                     |   2 +-
 t/t0001-init.sh                               |  13 +-
 t/t1400-update-ref.sh                         |  10 +-
 t/t3200-branch.sh                             |  16 +-
 t/t3201-branch-contains.sh                    |   8 +-
 t/t3203-branch-output.sh                      |   4 +-
 t/t3205-branch-color.sh                       |   8 +-
 t/t4013-diff-various.sh                       | 177 +++++++++---------
 ...ree_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...iff.diff-tree_--cc_--patch-with-stat_main} |   2 +-
 ...r => diff.diff-tree_--cc_--shortstat_main} |   2 +-
 ...diff.diff-tree_--cc_--stat_--summary_main} |   2 +-
 ...master => diff.diff-tree_--cc_--stat_main} |   2 +-
 ...e_--cc_master => diff.diff-tree_--cc_main} |   2 +-
 ...master => diff.diff-tree_-c_--abbrev_main} |   2 +-
 ...> diff.diff-tree_-c_--stat_--summary_main} |   2 +-
 ...t_master => diff.diff-tree_-c_--stat_main} |   2 +-
 ...-tree_-c_master => diff.diff-tree_-c_main} |   2 +-
 ...-p_-m_master => diff.diff-tree_-p_-m_main} |   2 +-
 t/t4013/diff.diff-tree_-p_main                |   2 +
 t/t4013/diff.diff-tree_-p_master              |   2 -
 t/t4013/diff.diff-tree_main                   |   2 +
 t/t4013/diff.diff-tree_master                 |   2 -
 t/t4013/diff.diff_--dirstat_--cc_main~1_main  |   3 +
 .../diff.diff_--dirstat_--cc_master~1_master  |   3 -
 t/t4013/diff.diff_--dirstat_main~1_main~2     |   3 +
 t/t4013/diff.diff_--dirstat_master~1_master~2 |   3 -
 ...ff.diff_--line-prefix=abc_main_main^_side} |   2 +-
 ...master^_side => diff.diff_main_main^_side} |   2 +-
 ...mat-patch_--attach_--stdout_initial..main} |   2 +-
 ...at-patch_--attach_--stdout_initial..main^} |   2 +-
 ...e_--stdout_--numbered-files_initial..main} |   2 +-
 ...t_--subject-prefix=TESTCASE_initial..main} |   2 +-
 ...mat-patch_--inline_--stdout_initial..main} |   2 +-
 ...at-patch_--inline_--stdout_initial..main^} |   2 +-
 ...t-patch_--inline_--stdout_initial..main^^} |   2 +-
 ...--stdout_--cover-letter_-n_initial..main^} |   2 +-
 ...atch_--stdout_--no-numbered_initial..main} |   2 +-
 ...t-patch_--stdout_--numbered_initial..main} |   2 +-
 ... diff.format-patch_--stdout_initial..main} |   2 +-
 ...diff.format-patch_--stdout_initial..main^} |   2 +-
 t/t4013/diff.log_--decorate=full_--all        |   2 +-
 t/t4013/diff.log_--decorate_--all             |   2 +-
 ..._--diff-merges=off_-p_--first-parent_main} |   2 +-
 ..._--first-parent_--diff-merges=off_-p_main} |   2 +-
 ...g_--no-diff-merges_-p_--first-parent_main} |   2 +-
 ..._--patch-with-stat_--summary_main_--_dir_} |   2 +-
 ...master => diff.log_--patch-with-stat_main} |   2 +-
 ...> diff.log_--patch-with-stat_main_--_dir_} |   2 +-
 ...oot_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...g_--root_--patch-with-stat_--summary_main} |   2 +-
 ...=> diff.log_--root_--patch-with-stat_main} |   2 +-
 ...-root_-c_--patch-with-stat_--summary_main} |   2 +-
 ...root_-p_master => diff.log_--root_-p_main} |   2 +-
 ...log_--root_master => diff.log_--root_main} |   2 +-
 ...ter => diff.log_-GF_-p_--pickaxe-all_main} |   2 +-
 ...log_-GF_-p_master => diff.log_-GF_-p_main} |   2 +-
 ...{diff.log_-SF_master => diff.log_-GF_main} |   2 +-
 ...log_-SF_-p_master => diff.log_-SF_-p_main} |   2 +-
 ...{diff.log_-GF_master => diff.log_-SF_main} |   2 +-
 t/t4013/diff.log_-SF_main_--max-count=0       |   2 +
 ...ount=2 => diff.log_-SF_main_--max-count=1} |   2 +-
 t/t4013/diff.log_-SF_main_--max-count=2       |   7 +
 t/t4013/diff.log_-SF_master_--max-count=0     |   2 -
 t/t4013/diff.log_-SF_master_--max-count=1     |   7 -
 ...iff.log_-S_F_master => diff.log_-S_F_main} |   2 +-
 ...ter => diff.log_-m_-p_--first-parent_main} |   2 +-
 ...f.log_-m_-p_master => diff.log_-m_-p_main} |   2 +-
 ...master => diff.log_-p_--first-parent_main} |   2 +-
 .../{diff.log_-p_master => diff.log_-p_main}  |   2 +-
 t/t4013/{diff.log_master => diff.log_main}    |   2 +-
 ...iff.noellipses-diff-tree_-c_--abbrev_main} |   2 +-
 ...> diff.noellipses-whatchanged_--root_main} |   2 +-
 ...r => diff.noellipses-whatchanged_-SF_main} |   2 +-
 ...aster => diff.noellipses-whatchanged_main} |   2 +-
 ...t_master => diff.show_--first-parent_main} |   2 +-
 ...{diff.show_-c_master => diff.show_-c_main} |   2 +-
 ...{diff.show_-m_master => diff.show_-m_main} |   2 +-
 t/t4013/{diff.show_master => diff.show_main}  |   2 +-
 ..._--patch-with-stat_--summary_main_--_dir_} |   2 +-
 ...> diff.whatchanged_--patch-with-stat_main} |   2 +-
 ...hatchanged_--patch-with-stat_main_--_dir_} |   2 +-
 ...oot_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...d_--root_--patch-with-stat_--summary_main} |   2 +-
 ...whatchanged_--root_--patch-with-stat_main} |   2 +-
 ...-root_-c_--patch-with-stat_--summary_main} |   2 +-
 ...master => diff.whatchanged_--root_-p_main} |   2 +-
 ...ot_master => diff.whatchanged_--root_main} |   2 +-
 ...-p_master => diff.whatchanged_-SF_-p_main} |   2 +-
 ...d_-SF_master => diff.whatchanged_-SF_main} |   2 +-
 ...ged_-p_master => diff.whatchanged_-p_main} |   2 +-
 ...atchanged_master => diff.whatchanged_main} |   2 +-
 t/t5505-remote.sh                             |  30 +--
 t/t5510-fetch.sh                              |   8 +-
 t/t5526-fetch-submodules.sh                   |  70 +++----
 t/t5606-clone-options.sh                      |   3 +
 t/t5703-upload-pack-ref-in-want.sh            |   6 +-
 t/t6200-fmt-merge-msg.sh                      |   2 +-
 t/t6302-for-each-ref-filter.sh                |  24 +--
 t/t9801-git-p4-branch.sh                      |  12 +-
 t/t9902-completion.sh                         |   6 +-
 t/test-lib.sh                                 |   7 +
 104 files changed, 311 insertions(+), 286 deletions(-)
 rename t/t4013/{diff.diff-tree_--cc_--patch-with-stat_--summary_master => diff.diff-tree_--cc_--patch-with-stat_--summary_main} (86%)
 rename t/t4013/{diff.diff-tree_--cc_--patch-with-stat_master => diff.diff-tree_--cc_--patch-with-stat_main} (89%)
 rename t/t4013/{diff.diff-tree_--cc_--shortstat_master => diff.diff-tree_--cc_--shortstat_main} (65%)
 rename t/t4013/{diff.diff-tree_-c_--stat_--summary_master => diff.diff-tree_--cc_--stat_--summary_main} (71%)
 rename t/t4013/{diff.diff-tree_-c_--stat_master => diff.diff-tree_--cc_--stat_main} (76%)
 rename t/t4013/{diff.diff-tree_--cc_master => diff.diff-tree_--cc_main} (91%)
 rename t/t4013/{diff.diff-tree_-c_--abbrev_master => diff.diff-tree_-c_--abbrev_main} (83%)
 rename t/t4013/{diff.diff-tree_--cc_--stat_--summary_master => diff.diff-tree_-c_--stat_--summary_main} (70%)
 rename t/t4013/{diff.diff-tree_--cc_--stat_master => diff.diff-tree_-c_--stat_main} (75%)
 rename t/t4013/{diff.diff-tree_-c_master => diff.diff-tree_-c_main} (93%)
 rename t/t4013/{diff.diff-tree_-p_-m_master => diff.diff-tree_-p_-m_main} (97%)
 create mode 100644 t/t4013/diff.diff-tree_-p_main
 delete mode 100644 t/t4013/diff.diff-tree_-p_master
 create mode 100644 t/t4013/diff.diff-tree_main
 delete mode 100644 t/t4013/diff.diff-tree_master
 create mode 100644 t/t4013/diff.diff_--dirstat_--cc_main~1_main
 delete mode 100644 t/t4013/diff.diff_--dirstat_--cc_master~1_master
 create mode 100644 t/t4013/diff.diff_--dirstat_main~1_main~2
 delete mode 100644 t/t4013/diff.diff_--dirstat_master~1_master~2
 rename t/t4013/{diff.diff_--line-prefix=abc_master_master^_side => diff.diff_--line-prefix=abc_main_main^_side} (87%)
 rename t/t4013/{diff.diff_master_master^_side => diff.diff_main_main^_side} (89%)
 rename t/t4013/{diff.format-patch_--attach_--stdout_initial..master => diff.format-patch_--attach_--stdout_initial..main} (98%)
 rename t/t4013/{diff.format-patch_--attach_--stdout_initial..master^ => diff.format-patch_--attach_--stdout_initial..main^} (97%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_--numbered-files_initial..master => diff.format-patch_--inline_--stdout_--numbered-files_initial..main} (99%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master => diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..main} (99%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master => diff.format-patch_--inline_--stdout_initial..main} (98%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master^ => diff.format-patch_--inline_--stdout_initial..main^} (97%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master^^ => diff.format-patch_--inline_--stdout_initial..main^^} (95%)
 rename t/t4013/{diff.format-patch_--stdout_--cover-letter_-n_initial..master^ => diff.format-patch_--stdout_--cover-letter_-n_initial..main^} (96%)
 rename t/t4013/{diff.format-patch_--stdout_--no-numbered_initial..master => diff.format-patch_--stdout_--no-numbered_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_--numbered_initial..master => diff.format-patch_--stdout_--numbered_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_initial..master => diff.format-patch_--stdout_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_initial..master^ => diff.format-patch_--stdout_initial..main^} (96%)
 rename t/t4013/{diff.log_--no-diff-merges_-p_--first-parent_master => diff.log_--diff-merges=off_-p_--first-parent_main} (95%)
 rename t/t4013/{diff.log_--first-parent_--diff-merges=off_-p_master => diff.log_--first-parent_--diff-merges=off_-p_main} (95%)
 rename t/t4013/{diff.log_--diff-merges=off_-p_--first-parent_master => diff.log_--no-diff-merges_-p_--first-parent_main} (95%)
 rename t/t4013/{diff.log_--patch-with-stat_--summary_master_--_dir_ => diff.log_--patch-with-stat_--summary_main_--_dir_} (96%)
 rename t/t4013/{diff.log_--patch-with-stat_master => diff.log_--patch-with-stat_main} (98%)
 rename t/t4013/{diff.log_--patch-with-stat_master_--_dir_ => diff.log_--patch-with-stat_main_--_dir_} (96%)
 rename t/t4013/{diff.log_--root_--cc_--patch-with-stat_--summary_master => diff.log_--root_--cc_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_--patch-with-stat_--summary_master => diff.log_--root_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_--patch-with-stat_master => diff.log_--root_--patch-with-stat_main} (98%)
 rename t/t4013/{diff.log_--root_-c_--patch-with-stat_--summary_master => diff.log_--root_-c_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_-p_master => diff.log_--root_-p_main} (98%)
 rename t/t4013/{diff.log_--root_master => diff.log_--root_main} (96%)
 rename t/t4013/{diff.log_-GF_-p_--pickaxe-all_master => diff.log_-GF_-p_--pickaxe-all_main} (90%)
 rename t/t4013/{diff.log_-GF_-p_master => diff.log_-GF_-p_main} (91%)
 rename t/t4013/{diff.log_-SF_master => diff.log_-GF_main} (86%)
 rename t/t4013/{diff.log_-SF_-p_master => diff.log_-SF_-p_main} (91%)
 rename t/t4013/{diff.log_-GF_master => diff.log_-SF_main} (86%)
 create mode 100644 t/t4013/diff.log_-SF_main_--max-count=0
 rename t/t4013/{diff.log_-SF_master_--max-count=2 => diff.log_-SF_main_--max-count=1} (79%)
 create mode 100644 t/t4013/diff.log_-SF_main_--max-count=2
 delete mode 100644 t/t4013/diff.log_-SF_master_--max-count=0
 delete mode 100644 t/t4013/diff.log_-SF_master_--max-count=1
 rename t/t4013/{diff.log_-S_F_master => diff.log_-S_F_main} (86%)
 rename t/t4013/{diff.log_-m_-p_--first-parent_master => diff.log_-m_-p_--first-parent_main} (97%)
 rename t/t4013/{diff.log_-m_-p_master => diff.log_-m_-p_main} (99%)
 rename t/t4013/{diff.log_-p_--first-parent_master => diff.log_-p_--first-parent_main} (97%)
 rename t/t4013/{diff.log_-p_master => diff.log_-p_main} (98%)
 rename t/t4013/{diff.log_master => diff.log_main} (97%)
 rename t/t4013/{diff.noellipses-diff-tree_-c_--abbrev_master => diff.noellipses-diff-tree_-c_--abbrev_main} (81%)
 rename t/t4013/{diff.noellipses-whatchanged_--root_master => diff.noellipses-whatchanged_--root_main} (96%)
 rename t/t4013/{diff.noellipses-whatchanged_-SF_master => diff.noellipses-whatchanged_-SF_main} (86%)
 rename t/t4013/{diff.noellipses-whatchanged_master => diff.noellipses-whatchanged_main} (96%)
 rename t/t4013/{diff.show_--first-parent_master => diff.show_--first-parent_main} (92%)
 rename t/t4013/{diff.show_-c_master => diff.show_-c_main} (95%)
 rename t/t4013/{diff.show_-m_master => diff.show_-m_main} (98%)
 rename t/t4013/{diff.show_master => diff.show_main} (96%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ => diff.whatchanged_--patch-with-stat_--summary_main_--_dir_} (94%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_master => diff.whatchanged_--patch-with-stat_main} (97%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_master_--_dir_ => diff.whatchanged_--patch-with-stat_main_--_dir_} (94%)
 rename t/t4013/{diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master => diff.whatchanged_--root_--cc_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_--patch-with-stat_--summary_master => diff.whatchanged_--root_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_--patch-with-stat_master => diff.whatchanged_--root_--patch-with-stat_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_-c_--patch-with-stat_--summary_master => diff.whatchanged_--root_-c_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_-p_master => diff.whatchanged_--root_-p_main} (98%)
 rename t/t4013/{diff.whatchanged_--root_master => diff.whatchanged_--root_main} (97%)
 rename t/t4013/{diff.whatchanged_-SF_-p_master => diff.whatchanged_-SF_-p_main} (89%)
 rename t/t4013/{diff.whatchanged_-SF_master => diff.whatchanged_-SF_main} (86%)
 rename t/t4013/{diff.whatchanged_-p_master => diff.whatchanged_-p_main} (98%)
 rename t/t4013/{diff.whatchanged_master => diff.whatchanged_main} (97%)

base-commit: 538228ed23a1d5e17e89bb17086d4dda51325bd8
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-758%2Fdscho%2Fprepare-for-main-branch-manual-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-758/dscho/prepare-for-main-branch-manual-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/758

Signature · 1 line
gitgitgadget
#1 lore raw

PATCH 1/10 fmt-merge-msg: also suppress "into main" by default

From: Johannes Schindelin <[email protected]>

In preparation for changing the default branch name to main, let's skip the suffix "into main" in merge commit messages.

---
 fmt-merge-msg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fmt-merge-msg.c +3 -1
index bd22e1ea88..9a664a4a58 100644
@@ -626,8 +626,10 @@ int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
 	void *current_branch_to_free;
 	struct merge_parents merge_parents;
 
-	if (!suppress_dest_pattern_seen)
+	if (!suppress_dest_pattern_seen) {
+		string_list_append(&suppress_dest_patterns, "main");
 		string_list_append(&suppress_dest_patterns, "master");
+	}
 
 	memset(&merge_parents, 0, sizeof(merge_parents));
 
Signature · 1 line
gitgitgadget
#4 lore raw

PATCH 2/10 t9801: use `--` in preparation for default branch rename

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

Seeing as we want to use main as the new default branch name used by git init, and that main is used as directory name in t9801, let's tighten the rev-list arguments to make it explicit when we are referring to a ref instead of a directory.

---
 t/t9801-git-p4-branch.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
t/t9801-git-p4-branch.sh +6 -6
index 67ff2711f5..a3abd778f9 100755
@@ -67,7 +67,7 @@ test_expect_success 'import main, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 4 wc
 	)
 '
@@ -78,7 +78,7 @@ test_expect_success 'import branch1, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -89,7 +89,7 @@ test_expect_success 'import branch2, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -100,7 +100,7 @@ test_expect_success 'import depot, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 8 wc
 	)
 '
@@ -114,7 +114,7 @@ test_expect_success 'import depot, branch detection' '
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
@@ -137,7 +137,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
Signature · 1 line
gitgitgadget
#6 lore raw

PATCH 3/10 tests: start moving to a different default main branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

To allow for an incremental conversion to a new default main branch name, let's introduce GIT_TEST_DEFAULT_MAIN_BRANCH_NAME. This environment variable can be set at the top of each converted test script, overriding the default main branch name to use when initializing new repositories (or cloning empty repositories).

Note: the GIT_TEST_DEFAULT_MAIN_BRANCH_NAME is _not_ intended to be used manually; many tests require a specific main branch name and cannot simply work with another one. This GIT_TEST_* variable is meant purely for the transitional period while the entire test suite is converted to use main as the initial branch name by default.

We also introduce the PREPARE_FOR_MAIN_BRANCH prereq that determines whether the default main branch name is main, and adjust a couple of test functions to use it. This prereq will be used to temporarily disable a couple test cases to allow for adjusting the test script incrementally. Once an entire test is adjusted, we will adjust the test so that it is run with GIT_TEST_DEFAULT_MAIN_BRANCH_NAME=main.

---
 refs.c                    |  5 ++++-
 t/lib-submodule-update.sh |  2 +-
 t/t0001-init.sh           | 13 ++++++++++---
 t/t5606-clone-options.sh  |  3 +++
 t/test-lib.sh             |  7 +++++++
 5 files changed, 25 insertions(+), 5 deletions(-)
refs.c +4 -1
index fa01153151..392f0bbf68 100644
@@ -567,8 +567,11 @@ char *repo_default_branch_name(struct repository *r)
 	const char *config_key = "init.defaultbranch";
 	const char *config_display_key = "init.defaultBranch";
 	char *ret = NULL, *full_ref;
+	const char *env = getenv("GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME");
 
-	if (repo_config_get_string(r, config_key, &ret) < 0)
+	if (env && *env)
+		ret = xstrdup(env);
+	else if (repo_config_get_string(r, config_key, &ret) < 0)
 		die(_("could not retrieve `%s`"), config_display_key);
 
 	if (!ret)
t/lib-submodule-update.sh +1 -1
index 87a759149f..bd3fa3c6da 100644
@@ -144,7 +144,7 @@ create_lib_submodule_repo () {
 		git checkout -b valid_sub1 &&
 		git revert HEAD &&
 
-		git checkout master
+		git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}"
 	)
 }
 
t/t0001-init.sh +10 -3
index 2f7c3dcd0f..69a320489f 100755
@@ -553,14 +553,21 @@ test_expect_success '--initial-branch' '
 
 test_expect_success 'overridden default initial branch name (config)' '
 	test_config_global init.defaultBranch nmb &&
-	git init initial-branch-config &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git init initial-branch-config &&
 	git -C initial-branch-config symbolic-ref HEAD >actual &&
 	grep nmb actual
 '
 
+test_expect_success 'overridden default main branch name (env)' '
+	test_config_global init.defaultBranch nmb &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=env git init main-branch-env &&
+	git -C main-branch-env symbolic-ref HEAD >actual &&
+	grep env actual
+'
+
 test_expect_success 'invalid default branch name' '
-	test_config_global init.defaultBranch "with space" &&
-	test_must_fail git init initial-branch-invalid 2>err &&
+	test_must_fail env GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME="with space" \
+		git init initial-branch-invalid 2>err &&
 	test_i18ngrep "invalid branch name" err
 '
 
t/t5606-clone-options.sh +3 -0
index e69427f881..856eebf222 100755
@@ -37,6 +37,7 @@ test_expect_success 'redirected clone -v does show progress' '
 
 test_expect_success 'chooses correct default initial branch name' '
 	git init --bare empty &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
 	git -c init.defaultBranch=up clone empty whats-up &&
 	test refs/heads/up = $(git -C whats-up symbolic-ref HEAD) &&
 	test refs/heads/up = $(git -C whats-up config branch.up.merge)
@@ -51,9 +52,11 @@ test_expect_success 'guesses initial branch name correctly' '
 
 	git -c init.defaultBranch=none init --bare no-head &&
 	git -C initial-branch push ../no-head guess abc &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
 	git clone no-head is-it2 &&
 	test_must_fail git -C is-it2 symbolic-ref refs/remotes/origin/HEAD &&
 	git -C no-head update-ref --no-deref HEAD refs/heads/guess &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
 	git -c init.defaultBranch=guess clone no-head is-it3 &&
 	test refs/remotes/origin/guess = \
 		$(git -C is-it3 symbolic-ref refs/remotes/origin/HEAD)
t/test-lib.sh +7 -0
index ef31f40037..6b35070d22 100644
@@ -1702,3 +1702,10 @@ test_lazy_prereq SHA1 '
 test_lazy_prereq REBASE_P '
 	test -z "$GIT_TEST_SKIP_REBASE_P"
 '
+# Special-purpose prereq for transitioning to a new default branch name:
+# Some tests need more than just a mindless (case-preserving) s/master/main/g
+# replacement. The non-trivial adjustments are guarded behind this
+# prerequisite, acting kind of as a feature flag
+test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
+	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
+'
Signature · 1 line
gitgitgadget
#11 lore raw

PATCH 5/10 t6200: adjust suppression pattern to also match "main"

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

In preparation to running t6200 with the default branch name set to "main", let's adjust the only non-trivial aspect thereof. The rest will be done via a trivial sed invocation.

---
 t/t6200-fmt-merge-msg.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t6200-fmt-merge-msg.sh +1 -1
index 7d549748ef..e61f8fb3d0 100755
@@ -556,7 +556,7 @@ test_expect_success 'merge.suppressDest configuration' '
 	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 &&
+	git -c merge.suppressDest="ma*" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
 	head -n1 full.3 >actual &&
 	grep -e "Merge branch .side." actual &&
 	! grep -e " into master$" actual
Signature · 1 line
gitgitgadget
#14 lore raw

PATCH 6/10 t5703: adjust a test case for the upcoming default branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

We want to rename the default branch name used by git init in the near future, using main as the new name.

In preparation for that, we adjust a test case that wants to rename the default branch to a different name that however has the same length. We use none as that name because it matches the length of main.

As this test case cannot possibly pass until the default branch name is _actually_ changed, we temporarily guard it behind a special-purpose prereq, until the test suite is fully converted to use that new default branch name.

---
 t/t5703-upload-pack-ref-in-want.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/t5703-upload-pack-ref-in-want.sh +3 -3
index d9ecf0f4a9..67f83e7c9b 100755
@@ -383,14 +383,14 @@ test_expect_success 'server is initially behind - ref in want' '
 	test_cmp expected actual
 '
 
-test_expect_success 'server loses a ref - ref in want' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	echo "s/master/raster/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
+	echo "s/main/none/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
 	test_must_fail git -C local fetch 2>err &&
 
-	test_i18ngrep "fatal: remote error: unknown ref refs/heads/raster" err
+	test_i18ngrep "fatal: remote error: unknown ref refs/heads/none" err
 '
 
 # DO NOT add non-httpd-specific tests here, because the last part of this
Signature · 1 line
gitgitgadget
#16 lore raw

PATCH 7/10 t3200: prepare for `main` being shorter than `master`

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

In the test case adjusted by this patch, we want to cut just after the longest shown ref name. Since main is shorter than master, we need to decrease the number of characters. Since main2 is shown, too, and since that is only one character shorter than master, we decrement the length by one.

---
 t/t3200-branch.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
t/t3200-branch.sh +2 -2
index 6efe7a44bc..55b24b76ce 100755
@@ -375,9 +375,9 @@ test_expect_success 'git branch --column -v should fail' '
 	test_must_fail git branch --column -v
 '
 
-test_expect_success 'git branch -v with column.ui ignored' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
-	COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
+	COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
   a/b/c
Signature · 1 line
gitgitgadget
#8 lore raw

PATCH 4/10 t4013: prepare for the new default branch name "main"

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

This patch is a bit involved, mainly because the default branch name is not only hard-coded in the script t4013-diff-various.sh itself, and not only in the support files in t/t4013/, but also in the _file names_ in t/t4013/.

The trick to adjust this test script was performed by inserting the definition GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main at the beginning of the test script, and then running these commands:

(cd t &&

 sed -i 's/master/main/g' -- \
	$(git grep -l master HEAD -- ./t4013\* | sed 's/HEAD://'))

and

eval "$(git ls-files t/t4013/ | sed -n \
	-e 's/\(.*\)master\(.*\)master\(.*\)/git mv & \1main\2main\3;/p')"

and

eval "$(git ls-files t/t4013/ | sed -n \
	-e 's/\(.*\)master\(.*\)/git mv & \1main\2;/p')"
---
 t/t4013-diff-various.sh                       | 177 +++++++++---------
 ...ree_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...iff.diff-tree_--cc_--patch-with-stat_main} |   2 +-
 ...r => diff.diff-tree_--cc_--shortstat_main} |   2 +-
 ...diff.diff-tree_--cc_--stat_--summary_main} |   2 +-
 ...master => diff.diff-tree_--cc_--stat_main} |   2 +-
 ...e_--cc_master => diff.diff-tree_--cc_main} |   2 +-
 ...master => diff.diff-tree_-c_--abbrev_main} |   2 +-
 ...> diff.diff-tree_-c_--stat_--summary_main} |   2 +-
 ...t_master => diff.diff-tree_-c_--stat_main} |   2 +-
 ...-tree_-c_master => diff.diff-tree_-c_main} |   2 +-
 ...-p_-m_master => diff.diff-tree_-p_-m_main} |   2 +-
 t/t4013/diff.diff-tree_-p_main                |   2 +
 t/t4013/diff.diff-tree_-p_master              |   2 -
 t/t4013/diff.diff-tree_main                   |   2 +
 t/t4013/diff.diff-tree_master                 |   2 -
 t/t4013/diff.diff_--dirstat_--cc_main~1_main  |   3 +
 .../diff.diff_--dirstat_--cc_master~1_master  |   3 -
 t/t4013/diff.diff_--dirstat_main~1_main~2     |   3 +
 t/t4013/diff.diff_--dirstat_master~1_master~2 |   3 -
 ...ff.diff_--line-prefix=abc_main_main^_side} |   2 +-
 ...master^_side => diff.diff_main_main^_side} |   2 +-
 ...mat-patch_--attach_--stdout_initial..main} |   2 +-
 ...at-patch_--attach_--stdout_initial..main^} |   2 +-
 ...e_--stdout_--numbered-files_initial..main} |   2 +-
 ...t_--subject-prefix=TESTCASE_initial..main} |   2 +-
 ...mat-patch_--inline_--stdout_initial..main} |   2 +-
 ...at-patch_--inline_--stdout_initial..main^} |   2 +-
 ...t-patch_--inline_--stdout_initial..main^^} |   2 +-
 ...--stdout_--cover-letter_-n_initial..main^} |   2 +-
 ...atch_--stdout_--no-numbered_initial..main} |   2 +-
 ...t-patch_--stdout_--numbered_initial..main} |   2 +-
 ... diff.format-patch_--stdout_initial..main} |   2 +-
 ...diff.format-patch_--stdout_initial..main^} |   2 +-
 t/t4013/diff.log_--decorate=full_--all        |   2 +-
 t/t4013/diff.log_--decorate_--all             |   2 +-
 ..._--diff-merges=off_-p_--first-parent_main} |   2 +-
 ..._--first-parent_--diff-merges=off_-p_main} |   2 +-
 ...g_--no-diff-merges_-p_--first-parent_main} |   2 +-
 ..._--patch-with-stat_--summary_main_--_dir_} |   2 +-
 ...master => diff.log_--patch-with-stat_main} |   2 +-
 ...> diff.log_--patch-with-stat_main_--_dir_} |   2 +-
 ...oot_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...g_--root_--patch-with-stat_--summary_main} |   2 +-
 ...=> diff.log_--root_--patch-with-stat_main} |   2 +-
 ...-root_-c_--patch-with-stat_--summary_main} |   2 +-
 ...root_-p_master => diff.log_--root_-p_main} |   2 +-
 ...log_--root_master => diff.log_--root_main} |   2 +-
 ...ter => diff.log_-GF_-p_--pickaxe-all_main} |   2 +-
 ...log_-GF_-p_master => diff.log_-GF_-p_main} |   2 +-
 ...{diff.log_-SF_master => diff.log_-GF_main} |   2 +-
 ...log_-SF_-p_master => diff.log_-SF_-p_main} |   2 +-
 ...{diff.log_-GF_master => diff.log_-SF_main} |   2 +-
 t/t4013/diff.log_-SF_main_--max-count=0       |   2 +
 ...ount=2 => diff.log_-SF_main_--max-count=1} |   2 +-
 t/t4013/diff.log_-SF_main_--max-count=2       |   7 +
 t/t4013/diff.log_-SF_master_--max-count=0     |   2 -
 t/t4013/diff.log_-SF_master_--max-count=1     |   7 -
 ...iff.log_-S_F_master => diff.log_-S_F_main} |   2 +-
 ...ter => diff.log_-m_-p_--first-parent_main} |   2 +-
 ...f.log_-m_-p_master => diff.log_-m_-p_main} |   2 +-
 ...master => diff.log_-p_--first-parent_main} |   2 +-
 .../{diff.log_-p_master => diff.log_-p_main}  |   2 +-
 t/t4013/{diff.log_master => diff.log_main}    |   2 +-
 ...iff.noellipses-diff-tree_-c_--abbrev_main} |   2 +-
 ...> diff.noellipses-whatchanged_--root_main} |   2 +-
 ...r => diff.noellipses-whatchanged_-SF_main} |   2 +-
 ...aster => diff.noellipses-whatchanged_main} |   2 +-
 ...t_master => diff.show_--first-parent_main} |   2 +-
 ...{diff.show_-c_master => diff.show_-c_main} |   2 +-
 ...{diff.show_-m_master => diff.show_-m_main} |   2 +-
 t/t4013/{diff.show_master => diff.show_main}  |   2 +-
 ..._--patch-with-stat_--summary_main_--_dir_} |   2 +-
 ...> diff.whatchanged_--patch-with-stat_main} |   2 +-
 ...hatchanged_--patch-with-stat_main_--_dir_} |   2 +-
 ...oot_--cc_--patch-with-stat_--summary_main} |   2 +-
 ...d_--root_--patch-with-stat_--summary_main} |   2 +-
 ...whatchanged_--root_--patch-with-stat_main} |   2 +-
 ...-root_-c_--patch-with-stat_--summary_main} |   2 +-
 ...master => diff.whatchanged_--root_-p_main} |   2 +-
 ...ot_master => diff.whatchanged_--root_main} |   2 +-
 ...-p_master => diff.whatchanged_-SF_-p_main} |   2 +-
 ...d_-SF_master => diff.whatchanged_-SF_main} |   2 +-
 ...ged_-p_master => diff.whatchanged_-p_main} |   2 +-
 ...atchanged_master => diff.whatchanged_main} |   2 +-
 85 files changed, 181 insertions(+), 178 deletions(-)
 rename t/t4013/{diff.diff-tree_--cc_--patch-with-stat_--summary_master => diff.diff-tree_--cc_--patch-with-stat_--summary_main} (86%)
 rename t/t4013/{diff.diff-tree_--cc_--patch-with-stat_master => diff.diff-tree_--cc_--patch-with-stat_main} (89%)
 rename t/t4013/{diff.diff-tree_--cc_--shortstat_master => diff.diff-tree_--cc_--shortstat_main} (65%)
 rename t/t4013/{diff.diff-tree_-c_--stat_--summary_master => diff.diff-tree_--cc_--stat_--summary_main} (71%)
 rename t/t4013/{diff.diff-tree_-c_--stat_master => diff.diff-tree_--cc_--stat_main} (76%)
 rename t/t4013/{diff.diff-tree_--cc_master => diff.diff-tree_--cc_main} (91%)
 rename t/t4013/{diff.diff-tree_-c_--abbrev_master => diff.diff-tree_-c_--abbrev_main} (83%)
 rename t/t4013/{diff.diff-tree_--cc_--stat_--summary_master => diff.diff-tree_-c_--stat_--summary_main} (70%)
 rename t/t4013/{diff.diff-tree_--cc_--stat_master => diff.diff-tree_-c_--stat_main} (75%)
 rename t/t4013/{diff.diff-tree_-c_master => diff.diff-tree_-c_main} (93%)
 rename t/t4013/{diff.diff-tree_-p_-m_master => diff.diff-tree_-p_-m_main} (97%)
 create mode 100644 t/t4013/diff.diff-tree_-p_main
 delete mode 100644 t/t4013/diff.diff-tree_-p_master
 create mode 100644 t/t4013/diff.diff-tree_main
 delete mode 100644 t/t4013/diff.diff-tree_master
 create mode 100644 t/t4013/diff.diff_--dirstat_--cc_main~1_main
 delete mode 100644 t/t4013/diff.diff_--dirstat_--cc_master~1_master
 create mode 100644 t/t4013/diff.diff_--dirstat_main~1_main~2
 delete mode 100644 t/t4013/diff.diff_--dirstat_master~1_master~2
 rename t/t4013/{diff.diff_--line-prefix=abc_master_master^_side => diff.diff_--line-prefix=abc_main_main^_side} (87%)
 rename t/t4013/{diff.diff_master_master^_side => diff.diff_main_main^_side} (89%)
 rename t/t4013/{diff.format-patch_--attach_--stdout_initial..master => diff.format-patch_--attach_--stdout_initial..main} (98%)
 rename t/t4013/{diff.format-patch_--attach_--stdout_initial..master^ => diff.format-patch_--attach_--stdout_initial..main^} (97%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_--numbered-files_initial..master => diff.format-patch_--inline_--stdout_--numbered-files_initial..main} (99%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master => diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..main} (99%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master => diff.format-patch_--inline_--stdout_initial..main} (98%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master^ => diff.format-patch_--inline_--stdout_initial..main^} (97%)
 rename t/t4013/{diff.format-patch_--inline_--stdout_initial..master^^ => diff.format-patch_--inline_--stdout_initial..main^^} (95%)
 rename t/t4013/{diff.format-patch_--stdout_--cover-letter_-n_initial..master^ => diff.format-patch_--stdout_--cover-letter_-n_initial..main^} (96%)
 rename t/t4013/{diff.format-patch_--stdout_--no-numbered_initial..master => diff.format-patch_--stdout_--no-numbered_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_--numbered_initial..master => diff.format-patch_--stdout_--numbered_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_initial..master => diff.format-patch_--stdout_initial..main} (97%)
 rename t/t4013/{diff.format-patch_--stdout_initial..master^ => diff.format-patch_--stdout_initial..main^} (96%)
 rename t/t4013/{diff.log_--no-diff-merges_-p_--first-parent_master => diff.log_--diff-merges=off_-p_--first-parent_main} (95%)
 rename t/t4013/{diff.log_--first-parent_--diff-merges=off_-p_master => diff.log_--first-parent_--diff-merges=off_-p_main} (95%)
 rename t/t4013/{diff.log_--diff-merges=off_-p_--first-parent_master => diff.log_--no-diff-merges_-p_--first-parent_main} (95%)
 rename t/t4013/{diff.log_--patch-with-stat_--summary_master_--_dir_ => diff.log_--patch-with-stat_--summary_main_--_dir_} (96%)
 rename t/t4013/{diff.log_--patch-with-stat_master => diff.log_--patch-with-stat_main} (98%)
 rename t/t4013/{diff.log_--patch-with-stat_master_--_dir_ => diff.log_--patch-with-stat_main_--_dir_} (96%)
 rename t/t4013/{diff.log_--root_--cc_--patch-with-stat_--summary_master => diff.log_--root_--cc_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_--patch-with-stat_--summary_master => diff.log_--root_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_--patch-with-stat_master => diff.log_--root_--patch-with-stat_main} (98%)
 rename t/t4013/{diff.log_--root_-c_--patch-with-stat_--summary_master => diff.log_--root_-c_--patch-with-stat_--summary_main} (98%)
 rename t/t4013/{diff.log_--root_-p_master => diff.log_--root_-p_main} (98%)
 rename t/t4013/{diff.log_--root_master => diff.log_--root_main} (96%)
 rename t/t4013/{diff.log_-GF_-p_--pickaxe-all_master => diff.log_-GF_-p_--pickaxe-all_main} (90%)
 rename t/t4013/{diff.log_-GF_-p_master => diff.log_-GF_-p_main} (91%)
 rename t/t4013/{diff.log_-SF_master => diff.log_-GF_main} (86%)
 rename t/t4013/{diff.log_-SF_-p_master => diff.log_-SF_-p_main} (91%)
 rename t/t4013/{diff.log_-GF_master => diff.log_-SF_main} (86%)
 create mode 100644 t/t4013/diff.log_-SF_main_--max-count=0
 rename t/t4013/{diff.log_-SF_master_--max-count=2 => diff.log_-SF_main_--max-count=1} (79%)
 create mode 100644 t/t4013/diff.log_-SF_main_--max-count=2
 delete mode 100644 t/t4013/diff.log_-SF_master_--max-count=0
 delete mode 100644 t/t4013/diff.log_-SF_master_--max-count=1
 rename t/t4013/{diff.log_-S_F_master => diff.log_-S_F_main} (86%)
 rename t/t4013/{diff.log_-m_-p_--first-parent_master => diff.log_-m_-p_--first-parent_main} (97%)
 rename t/t4013/{diff.log_-m_-p_master => diff.log_-m_-p_main} (99%)
 rename t/t4013/{diff.log_-p_--first-parent_master => diff.log_-p_--first-parent_main} (97%)
 rename t/t4013/{diff.log_-p_master => diff.log_-p_main} (98%)
 rename t/t4013/{diff.log_master => diff.log_main} (97%)
 rename t/t4013/{diff.noellipses-diff-tree_-c_--abbrev_master => diff.noellipses-diff-tree_-c_--abbrev_main} (81%)
 rename t/t4013/{diff.noellipses-whatchanged_--root_master => diff.noellipses-whatchanged_--root_main} (96%)
 rename t/t4013/{diff.noellipses-whatchanged_-SF_master => diff.noellipses-whatchanged_-SF_main} (86%)
 rename t/t4013/{diff.noellipses-whatchanged_master => diff.noellipses-whatchanged_main} (96%)
 rename t/t4013/{diff.show_--first-parent_master => diff.show_--first-parent_main} (92%)
 rename t/t4013/{diff.show_-c_master => diff.show_-c_main} (95%)
 rename t/t4013/{diff.show_-m_master => diff.show_-m_main} (98%)
 rename t/t4013/{diff.show_master => diff.show_main} (96%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ => diff.whatchanged_--patch-with-stat_--summary_main_--_dir_} (94%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_master => diff.whatchanged_--patch-with-stat_main} (97%)
 rename t/t4013/{diff.whatchanged_--patch-with-stat_master_--_dir_ => diff.whatchanged_--patch-with-stat_main_--_dir_} (94%)
 rename t/t4013/{diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master => diff.whatchanged_--root_--cc_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_--patch-with-stat_--summary_master => diff.whatchanged_--root_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_--patch-with-stat_master => diff.whatchanged_--root_--patch-with-stat_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_-c_--patch-with-stat_--summary_master => diff.whatchanged_--root_-c_--patch-with-stat_--summary_main} (97%)
 rename t/t4013/{diff.whatchanged_--root_-p_master => diff.whatchanged_--root_-p_main} (98%)
 rename t/t4013/{diff.whatchanged_--root_master => diff.whatchanged_--root_main} (97%)
 rename t/t4013/{diff.whatchanged_-SF_-p_master => diff.whatchanged_-SF_-p_main} (89%)
 rename t/t4013/{diff.whatchanged_-SF_master => diff.whatchanged_-SF_main} (86%)
 rename t/t4013/{diff.whatchanged_-p_master => diff.whatchanged_-p_main} (98%)
 rename t/t4013/{diff.whatchanged_master => diff.whatchanged_main} (97%)
t/t4013-diff-various.sh +90 -87
index 5c7b0122b4..1d0ce8de25 100755
@@ -5,6 +5,9 @@
 
 test_description='Various diff formatting options'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
@@ -60,7 +63,7 @@ test_expect_success setup '
 	GIT_COMMITTER_DATE="2006-06-26 00:04:00 +0000" &&
 	export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&
 
-	git checkout master &&
+	git checkout main &&
 	git pull -s ours . side &&
 
 	GIT_AUTHOR_DATE="2006-06-26 00:05:00 +0000" &&
@@ -85,7 +88,7 @@ test_expect_success setup '
 	for i in B A; do echo $i; done >dir/sub &&
 	git add dir/sub &&
 	git commit -m "Rearranged lines in dir/sub" &&
-	git checkout master &&
+	git checkout main &&
 
 	GIT_AUTHOR_DATE="2006-06-26 00:06:00 +0000" &&
 	GIT_COMMITTER_DATE="2006-06-26 00:06:00 +0000" &&
@@ -93,7 +96,7 @@ test_expect_success setup '
 	git checkout -b mode initial &&
 	git update-index --chmod=+x file0 &&
 	git commit -m "update mode" &&
-	git checkout -f master &&
+	git checkout -f main &&
 
 	GIT_AUTHOR_DATE="2006-06-26 00:06:00 +0000" &&
 	GIT_COMMITTER_DATE="2006-06-26 00:06:00 +0000" &&
@@ -102,12 +105,12 @@ test_expect_success setup '
 	git update-index --chmod=+x file2 &&
 	git commit -m "update mode (file2)" &&
 	git notes add -m "note" &&
-	git checkout -f master &&
+	git checkout -f main &&
 
-	# Same merge as master, but with parents reversed. Hide it in a
+	# Same merge as main, but with parents reversed. Hide it in a
 	# pseudo-ref to avoid impacting tests with --all.
 	commit=$(echo reverse |
-		 git commit-tree -p master^2 -p master^1 master^{tree}) &&
+		 git commit-tree -p main^2 -p main^1 main^{tree}) &&
 	git update-ref REVERSE $commit &&
 
 	git config diff.renames false &&
@@ -117,15 +120,15 @@ test_expect_success setup '
 
 : <<\EOF
 ! [initial] Initial
- * [master] Merge branch 'side'
+ * [main] Merge branch 'side'
   ! [rearrange] Rearranged lines in dir/sub
    ! [side] Side
 ----
   +  [rearrange] Rearranged lines in dir/sub
- -   [master] Merge branch 'side'
+ -   [main] Merge branch 'side'
  * + [side] Side
- *   [master^] Third
- *   [master~2] Second
+ *   [main^] Third
+ *   [main~2] Second
 +*++ [initial] Initial
 EOF
 
@@ -283,91 +286,91 @@ diff-tree initial mode
 diff-tree --stat initial mode
 diff-tree --summary initial mode
 
-diff-tree master
-diff-tree -p master
-diff-tree -p -m master
-diff-tree -c master
-diff-tree -c --abbrev master
-:noellipses diff-tree -c --abbrev master
-diff-tree --cc master
+diff-tree main
+diff-tree -p main
+diff-tree -p -m main
+diff-tree -c main
+diff-tree -c --abbrev main
+:noellipses diff-tree -c --abbrev main
+diff-tree --cc main
 # stat only should show the diffstat with the first parent
-diff-tree -c --stat master
-diff-tree --cc --stat master
-diff-tree -c --stat --summary master
-diff-tree --cc --stat --summary master
+diff-tree -c --stat main
+diff-tree --cc --stat main
+diff-tree -c --stat --summary main
+diff-tree --cc --stat --summary main
 # stat summary should show the diffstat and summary with the first parent
 diff-tree -c --stat --summary side
 diff-tree --cc --stat --summary side
-diff-tree --cc --shortstat master
+diff-tree --cc --shortstat main
 diff-tree --cc --summary REVERSE
 # improved by Timo's patch
-diff-tree --cc --patch-with-stat master
+diff-tree --cc --patch-with-stat main
 # improved by Timo's patch
-diff-tree --cc --patch-with-stat --summary master
+diff-tree --cc --patch-with-stat --summary main
 # this is correct
 diff-tree --cc --patch-with-stat --summary side
 
-log master
-log -p master
-log --root master
-log --root -p master
-log --patch-with-stat master
-log --root --patch-with-stat master
-log --root --patch-with-stat --summary master
+log main
+log -p main
+log --root main
+log --root -p main
+log --patch-with-stat main
+log --root --patch-with-stat main
+log --root --patch-with-stat --summary main
 # improved by Timo's patch
-log --root -c --patch-with-stat --summary master
+log --root -c --patch-with-stat --summary main
 # improved by Timo's patch
-log --root --cc --patch-with-stat --summary master
-log --no-diff-merges -p --first-parent master
-log --diff-merges=off -p --first-parent master
-log --first-parent --diff-merges=off -p master
-log -p --first-parent master
-log -m -p --first-parent master
-log -m -p master
-log -SF master
-log -S F master
-log -SF -p master
-log -SF master --max-count=0
-log -SF master --max-count=1
-log -SF master --max-count=2
-log -GF master
-log -GF -p master
-log -GF -p --pickaxe-all master
+log --root --cc --patch-with-stat --summary main
+log --no-diff-merges -p --first-parent main
+log --diff-merges=off -p --first-parent main
+log --first-parent --diff-merges=off -p main
+log -p --first-parent main
+log -m -p --first-parent main
+log -m -p main
+log -SF main
+log -S F main
+log -SF -p main
+log -SF main --max-count=0
+log -SF main --max-count=1
+log -SF main --max-count=2
+log -GF main
+log -GF -p main
+log -GF -p --pickaxe-all main
 log --decorate --all
 log --decorate=full --all
 
 rev-list --parents HEAD
 rev-list --children HEAD
 
-whatchanged master
-:noellipses whatchanged master
-whatchanged -p master
-whatchanged --root master
-:noellipses whatchanged --root master
-whatchanged --root -p master
-whatchanged --patch-with-stat master
-whatchanged --root --patch-with-stat master
-whatchanged --root --patch-with-stat --summary master
+whatchanged main
+:noellipses whatchanged main
+whatchanged -p main
+whatchanged --root main
+:noellipses whatchanged --root main
+whatchanged --root -p main
+whatchanged --patch-with-stat main
+whatchanged --root --patch-with-stat main
+whatchanged --root --patch-with-stat --summary main
 # improved by Timo's patch
-whatchanged --root -c --patch-with-stat --summary master
+whatchanged --root -c --patch-with-stat --summary main
 # improved by Timo's patch
-whatchanged --root --cc --patch-with-stat --summary master
-whatchanged -SF master
-:noellipses whatchanged -SF master
-whatchanged -SF -p master
+whatchanged --root --cc --patch-with-stat --summary main
+whatchanged -SF main
+:noellipses whatchanged -SF main
+whatchanged -SF -p main
 
-log --patch-with-stat master -- dir/
-whatchanged --patch-with-stat master -- dir/
-log --patch-with-stat --summary master -- dir/
-whatchanged --patch-with-stat --summary master -- dir/
+log --patch-with-stat main -- dir/
+whatchanged --patch-with-stat main -- dir/
+log --patch-with-stat --summary main -- dir/
+whatchanged --patch-with-stat --summary main -- dir/
 
 show initial
 show --root initial
 show side
-show master
-show -c master
-show -m master
-show --first-parent master
+show main
+show -c main
+show -m main
+show --first-parent main
 show --stat side
 show --stat --summary side
 show --patch-with-stat side
@@ -376,22 +379,22 @@ show --patch-with-raw side
 show --patch-with-stat --summary side
 
 format-patch --stdout initial..side
-format-patch --stdout initial..master^
-format-patch --stdout initial..master
-format-patch --stdout --no-numbered initial..master
-format-patch --stdout --numbered initial..master
+format-patch --stdout initial..main^
+format-patch --stdout initial..main
+format-patch --stdout --no-numbered initial..main
+format-patch --stdout --numbered initial..main
 format-patch --attach --stdout initial..side
 format-patch --attach --stdout --suffix=.diff initial..side
-format-patch --attach --stdout initial..master^
-format-patch --attach --stdout initial..master
+format-patch --attach --stdout initial..main^
+format-patch --attach --stdout initial..main
 format-patch --inline --stdout initial..side
-format-patch --inline --stdout initial..master^
-format-patch --inline --stdout --numbered-files initial..master
-format-patch --inline --stdout initial..master
-format-patch --inline --stdout --subject-prefix=TESTCASE initial..master
+format-patch --inline --stdout initial..main^
+format-patch --inline --stdout --numbered-files initial..main
+format-patch --inline --stdout initial..main
+format-patch --inline --stdout --subject-prefix=TESTCASE initial..main
 config format.subjectprefix DIFFERENT_PREFIX
-format-patch --inline --stdout initial..master^^
-format-patch --stdout --cover-letter -n initial..master^
+format-patch --inline --stdout initial..main^^
+format-patch --stdout --cover-letter -n initial..main^
 
 diff --abbrev initial..side
 diff -U initial..side
@@ -410,13 +413,13 @@ diff --name-status dir2 dir
 diff --no-index --name-status dir2 dir
 diff --no-index --name-status -- dir2 dir
 diff --no-index dir dir3
-diff master master^ side
+diff main main^ side
 # Can't use spaces...
-diff --line-prefix=abc master master^ side
-diff --dirstat master~1 master~2
+diff --line-prefix=abc main main^ side
+diff --dirstat main~1 main~2
 diff --dirstat initial rearrange
 diff --dirstat-by-file initial rearrange
-diff --dirstat --cc master~1 master
+diff --dirstat --cc main~1 main
 # No-index --abbrev and --no-abbrev
 diff --raw initial
 :noellipses diff --raw initial
@@ -469,7 +472,7 @@ test_expect_success 'diff-tree --stdin with log formatting' '
 	Third
 	Second
 	EOF
-	git rev-list master | git diff-tree --stdin --format=%s -s >actual &&
+	git rev-list main | git diff-tree --stdin --format=%s -s >actual &&
 	test_cmp expect actual
 '
 
t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_main renamed from t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master +1 -1
similarity index 86%
rename from t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master
rename to t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_main
index 9951e3677d..af1cf20f4c 100644
@@ -1,4 +1,4 @@
-$ git diff-tree --cc --patch-with-stat --summary master
+$ git diff-tree --cc --patch-with-stat --summary main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
  dir/sub | 2 ++
  file0   | 3 +++
t/t4013/diff.diff-tree_--cc_--patch-with-stat_main renamed from t/t4013/diff.diff-tree_--cc_--patch-with-stat_master +1 -1
similarity index 89%
rename from t/t4013/diff.diff-tree_--cc_--patch-with-stat_master
rename to t/t4013/diff.diff-tree_--cc_--patch-with-stat_main
index db3c0a7b2c..0ec6042097 100644
@@ -1,4 +1,4 @@
-$ git diff-tree --cc --patch-with-stat master
+$ git diff-tree --cc --patch-with-stat main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
  dir/sub | 2 ++
  file0   | 3 +++
t/t4013/diff.diff-tree_--cc_--shortstat_main renamed from t/t4013/diff.diff-tree_--cc_--shortstat_master +1 -1
similarity index 65%
rename from t/t4013/diff.diff-tree_--cc_--shortstat_master
rename to t/t4013/diff.diff-tree_--cc_--shortstat_main
index a4ca42df2a..9a4ef03197 100644
@@ -1,4 +1,4 @@
-$ git diff-tree --cc --shortstat master
+$ git diff-tree --cc --shortstat main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
  2 files changed, 5 insertions(+)
 $
t/t4013/diff.diff-tree_--cc_--stat_--summary_main renamed from t/t4013/diff.diff-tree_-c_--stat_--summary_master +1 -1
similarity index 71%
rename from t/t4013/diff.diff-tree_-c_--stat_--summary_master
rename to t/t4013/diff.diff-tree_--cc_--stat_--summary_main
index 81c3021541..9db08a4aa9 100644
@@ -1,4 +1,4 @@
-$ git diff-tree -c --stat --summary master
+$ git diff-tree --cc --stat --summary main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
  dir/sub | 2 ++
  file0   | 3 +++
t/t4013/diff.diff-tree_--cc_--stat_main renamed from t/t4013/diff.diff-tree_-c_--stat_master +1 -1
similarity index 76%
rename from t/t4013/diff.diff-tree_-c_--stat_master
rename to t/t4013/diff.diff-tree_--cc_--stat_main
index 89d59b1548..7ecc67a524 100644
@@ -1,4 +1,4 @@
-$ git diff-tree -c --stat master
+$ git diff-tree --cc --stat main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
  dir/sub | 2 ++
  file0   | 3 +++
t/t4013/diff.diff-tree_--cc_main renamed from t/t4013/diff.diff-tree_--cc_master +1 -1
similarity index 91%
rename from t/t4013/diff.diff-tree_--cc_master
rename to t/t4013/diff.diff-tree_--cc_main
index 5ecb4e14ae..1a962856ad 100644
@@ -1,4 +1,4 @@
-$ git diff-tree --cc master
+$ git diff-tree --cc main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
 diff --cc dir/sub
 index cead32e,7289e35..992913c
t/t4013/diff.diff-tree_-c_--abbrev_main renamed from t/t4013/diff.diff-tree_-c_--abbrev_master +1 -1
similarity index 83%
rename from t/t4013/diff.diff-tree_-c_--abbrev_master
rename to t/t4013/diff.diff-tree_-c_--abbrev_main
index b8e4aa2530..039d127cf2 100644
@@ -1,4 +1,4 @@
-$ git diff-tree -c --abbrev master
+$ git diff-tree -c --abbrev main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
 ::100644 100644 100644 cead32e... 7289e35... 992913c... MM	dir/sub
 ::100644 100644 100644 b414108... f4615da... 10a8a9f... MM	file0
t/t4013/diff.diff-tree_-c_--stat_--summary_main renamed from t/t4013/diff.diff-tree_--cc_--stat_--summary_master +1 -1
similarity index 70%
rename from t/t4013/diff.diff-tree_--cc_--stat_--summary_master
rename to t/t4013/diff.diff-tree_-c_--stat_--summary_main
index d019867dd9..05a8d16ba7 100644
@@ -1,4 +1,4 @@
-$ git diff-tree --cc --stat --summary master
+$ git diff-tree -c --stat --summary main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
  dir/sub | 2 ++
  file0   | 3 +++
t/t4013/diff.diff-tree_-c_--stat_main renamed from t/t4013/diff.diff-tree_--cc_--stat_master +1 -1
similarity index 75%
rename from t/t4013/diff.diff-tree_--cc_--stat_master
rename to t/t4013/diff.diff-tree_-c_--stat_main
index 40b91796b3..61d9f450df 100644
@@ -1,4 +1,4 @@
-$ git diff-tree --cc --stat master
+$ git diff-tree -c --stat main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
  dir/sub | 2 ++
  file0   | 3 +++
t/t4013/diff.diff-tree_-c_main renamed from t/t4013/diff.diff-tree_-c_master +1 -1
similarity index 93%
rename from t/t4013/diff.diff-tree_-c_master
rename to t/t4013/diff.diff-tree_-c_main
index e2d2bb2611..a84e1185cf 100644
@@ -1,4 +1,4 @@
-$ git diff-tree -c master
+$ git diff-tree -c main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
 ::100644 100644 100644 cead32e925b1420c84c14cbf7cf755e7e45af8ad 7289e35bff32727c08dda207511bec138fdb9ea5 992913c5aa0a5476d10c49ed0f21fc0c6d1aedf3 MM	dir/sub
 ::100644 100644 100644 b414108e81e5091fe0974a1858b4d0d22b107f70 f4615da674c09df322d6ba8d6b21ecfb1b1ba510 10a8a9f3657f91a156b9f0184ed79a20adef9f7f MM	file0
t/t4013/diff.diff-tree_-p_-m_main renamed from t/t4013/diff.diff-tree_-p_-m_master +1 -1
similarity index 97%
rename from t/t4013/diff.diff-tree_-p_-m_master
rename to t/t4013/diff.diff-tree_-p_-m_main
index b60bea039d..29c9fc20b8 100644
@@ -1,4 +1,4 @@
-$ git diff-tree -p -m master
+$ git diff-tree -p -m main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
 diff --git a/dir/sub b/dir/sub
 index cead32e..992913c 100644
t/t4013/diff.diff-tree_-p_main new file +2 -0
new file mode 100644
index 0000000000..c658062422
@@ -0,0 +1,2 @@
+$ git diff-tree -p main
+$
t/t4013/diff.diff-tree_-p_master deleted +0 -2
deleted file mode 100644
index b182875fb2..0000000000
@@ -1,2 +0,0 @@
-$ git diff-tree -p master
-$
t/t4013/diff.diff-tree_main new file +2 -0
new file mode 100644
index 0000000000..dc5b9fdeb6
@@ -0,0 +1,2 @@
+$ git diff-tree main
+$
t/t4013/diff.diff-tree_master deleted +0 -2
deleted file mode 100644
index fe9226f8a1..0000000000
@@ -1,2 +0,0 @@
-$ git diff-tree master
-$
t/t4013/diff.diff_--dirstat_--cc_main~1_main new file +3 -0
new file mode 100644
index 0000000000..168a357a02
@@ -0,0 +1,3 @@
+$ git diff --dirstat --cc main~1 main
+  40.0% dir/
+$
t/t4013/diff.diff_--dirstat_--cc_master~1_master deleted +0 -3
deleted file mode 100644
index fba4e34175..0000000000
@@ -1,3 +0,0 @@
-$ git diff --dirstat --cc master~1 master
-  40.0% dir/
-$
t/t4013/diff.diff_--dirstat_main~1_main~2 new file +3 -0
new file mode 100644
index 0000000000..6809733708
@@ -0,0 +1,3 @@
+$ git diff --dirstat main~1 main~2
+  40.0% dir/
+$
t/t4013/diff.diff_--dirstat_master~1_master~2 deleted +0 -3
deleted file mode 100644
index b672e1ca63..0000000000
@@ -1,3 +0,0 @@
-$ git diff --dirstat master~1 master~2
-  40.0% dir/
-$
t/t4013/diff.diff_--line-prefix=abc_main_main^_side renamed from t/t4013/diff.diff_--line-prefix=abc_master_master^_side +1 -1
similarity index 87%
rename from t/t4013/diff.diff_--line-prefix=abc_master_master^_side
rename to t/t4013/diff.diff_--line-prefix=abc_main_main^_side
index 99f91e7f0e..67a2145a36 100644
@@ -1,4 +1,4 @@
-$ git diff --line-prefix=abc master master^ side
+$ git diff --line-prefix=abc main main^ side
 abcdiff --cc dir/sub
 abcindex cead32e,7289e35..992913c
 abc--- a/dir/sub
t/t4013/diff.diff_main_main^_side renamed from t/t4013/diff.diff_master_master^_side +1 -1
similarity index 89%
rename from t/t4013/diff.diff_master_master^_side
rename to t/t4013/diff.diff_main_main^_side
index 50ec9cadd6..ab81ec9e47 100644
@@ -1,4 +1,4 @@
-$ git diff master master^ side
+$ git diff main main^ side
 diff --cc dir/sub
 index cead32e,7289e35..992913c
 --- a/dir/sub
t/t4013/diff.format-patch_--attach_--stdout_initial..main renamed from t/t4013/diff.format-patch_--attach_--stdout_initial..master +1 -1
similarity index 98%
rename from t/t4013/diff.format-patch_--attach_--stdout_initial..master
rename to t/t4013/diff.format-patch_--attach_--stdout_initial..main
index 52fedc179e..9f56380350 100644
@@ -1,4 +1,4 @@
-$ git format-patch --attach --stdout initial..master
+$ git format-patch --attach --stdout initial..main
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--attach_--stdout_initial..main^ renamed from t/t4013/diff.format-patch_--attach_--stdout_initial..master^ +1 -1
similarity index 97%
rename from t/t4013/diff.format-patch_--attach_--stdout_initial..master^
rename to t/t4013/diff.format-patch_--attach_--stdout_initial..main^
index 1c3cde251b..80132ea99e 100644
@@ -1,4 +1,4 @@
-$ git format-patch --attach --stdout initial..master^
+$ git format-patch --attach --stdout initial..main^
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..main renamed from t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..master +1 -1
similarity index 99%
rename from t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..master
rename to t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..main
index 02c4db7ec5..8e889090fb 100644
@@ -1,4 +1,4 @@
-$ git format-patch --inline --stdout --numbered-files initial..master
+$ git format-patch --inline --stdout --numbered-files initial..main
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..main renamed from t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master +1 -1
similarity index 99%
rename from t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master
rename to t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..main
index c7677c5951..d7d2b12d15 100644
@@ -1,4 +1,4 @@
-$ git format-patch --inline --stdout --subject-prefix=TESTCASE initial..master
+$ git format-patch --inline --stdout --subject-prefix=TESTCASE initial..main
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--inline_--stdout_initial..main renamed from t/t4013/diff.format-patch_--inline_--stdout_initial..master +1 -1
similarity index 98%
rename from t/t4013/diff.format-patch_--inline_--stdout_initial..master
rename to t/t4013/diff.format-patch_--inline_--stdout_initial..main
index 5b3e34e2c0..c49c423f82 100644
@@ -1,4 +1,4 @@
-$ git format-patch --inline --stdout initial..master
+$ git format-patch --inline --stdout initial..main
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--inline_--stdout_initial..main^ renamed from t/t4013/diff.format-patch_--inline_--stdout_initial..master^ +1 -1
similarity index 97%
rename from t/t4013/diff.format-patch_--inline_--stdout_initial..master^
rename to t/t4013/diff.format-patch_--inline_--stdout_initial..main^
index d13f8a8128..8669dbfe6c 100644
@@ -1,4 +1,4 @@
-$ git format-patch --inline --stdout initial..master^
+$ git format-patch --inline --stdout initial..main^
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--inline_--stdout_initial..main^^ renamed from t/t4013/diff.format-patch_--inline_--stdout_initial..master^^ +1 -1
similarity index 95%
rename from t/t4013/diff.format-patch_--inline_--stdout_initial..master^^
rename to t/t4013/diff.format-patch_--inline_--stdout_initial..main^^
index caec5537de..b749be58b0 100644
@@ -1,4 +1,4 @@
-$ git format-patch --inline --stdout initial..master^^
+$ git format-patch --inline --stdout initial..main^^
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..main^ renamed from t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^ +1 -1
similarity index 96%
rename from t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^
rename to t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..main^
index 244d964fc6..567f222198 100644
@@ -1,4 +1,4 @@
-$ git format-patch --stdout --cover-letter -n initial..master^
+$ git format-patch --stdout --cover-letter -n initial..main^
 From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001
 From: C O Mitter <[email protected]>
 Date: Mon, 26 Jun 2006 00:06:00 +0000
t/t4013/diff.format-patch_--stdout_--no-numbered_initial..main renamed from t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master +1 -1
similarity index 97%
rename from t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master
rename to t/t4013/diff.format-patch_--stdout_--no-numbered_initial..main
index bfc287a147..195b62ea4f 100644
@@ -1,4 +1,4 @@
-$ git format-patch --stdout --no-numbered initial..master
+$ git format-patch --stdout --no-numbered initial..main
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--stdout_--numbered_initial..main renamed from t/t4013/diff.format-patch_--stdout_--numbered_initial..master +1 -1
similarity index 97%
rename from t/t4013/diff.format-patch_--stdout_--numbered_initial..master
rename to t/t4013/diff.format-patch_--stdout_--numbered_initial..main
index 568f6f584e..0678a38515 100644
@@ -1,4 +1,4 @@
-$ git format-patch --stdout --numbered initial..master
+$ git format-patch --stdout --numbered initial..main
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--stdout_initial..main renamed from t/t4013/diff.format-patch_--stdout_initial..master +1 -1
similarity index 97%
rename from t/t4013/diff.format-patch_--stdout_initial..master
rename to t/t4013/diff.format-patch_--stdout_initial..main
index 5f0352f9f7..b4a6302e7c 100644
@@ -1,4 +1,4 @@
-$ git format-patch --stdout initial..master
+$ git format-patch --stdout initial..main
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.format-patch_--stdout_initial..main^ renamed from t/t4013/diff.format-patch_--stdout_initial..master^ +1 -1
similarity index 96%
rename from t/t4013/diff.format-patch_--stdout_initial..master^
rename to t/t4013/diff.format-patch_--stdout_initial..main^
index 2ae454d807..36b3221582 100644
@@ -1,4 +1,4 @@
-$ git format-patch --stdout initial..master^
+$ git format-patch --stdout initial..main^
 From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
 From: A U Thor <[email protected]>
 Date: Mon, 26 Jun 2006 00:01:00 +0000
t/t4013/diff.log_--decorate=full_--all +1 -1
index 3f9b872ece..7cfd2ea22d 100644
@@ -26,7 +26,7 @@ Date:   Mon Jun 26 00:06:00 2006 +0000
 
     Notes added by 'git notes add'
 
-commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD -> refs/heads/master)
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD -> refs/heads/main)
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:04:00 2006 +0000
t/t4013/diff.log_--decorate_--all +1 -1
index f5e20e1e14..735f1aa83c 100644
@@ -26,7 +26,7 @@ Date:   Mon Jun 26 00:06:00 2006 +0000
 
     Notes added by 'git notes add'
 
-commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD -> master)
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD -> main)
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:04:00 2006 +0000
t/t4013/diff.log_--diff-merges=off_-p_--first-parent_main renamed from t/t4013/diff.log_--no-diff-merges_-p_--first-parent_master +1 -1
similarity index 95%
rename from t/t4013/diff.log_--no-diff-merges_-p_--first-parent_master
rename to t/t4013/diff.log_--diff-merges=off_-p_--first-parent_main
index 597002232e..fe180fda3b 100644
@@ -1,4 +1,4 @@
-$ git log --no-diff-merges -p --first-parent master
+$ git log --diff-merges=off -p --first-parent main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--first-parent_--diff-merges=off_-p_main renamed from t/t4013/diff.log_--first-parent_--diff-merges=off_-p_master +1 -1
similarity index 95%
rename from t/t4013/diff.log_--first-parent_--diff-merges=off_-p_master
rename to t/t4013/diff.log_--first-parent_--diff-merges=off_-p_main
index 5d7461a167..dca62d4e60 100644
@@ -1,4 +1,4 @@
-$ git log --first-parent --diff-merges=off -p master
+$ git log --first-parent --diff-merges=off -p main
 commit 80e25ffa65bcdbe82ef654b4d06dbbde7945c37f
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--no-diff-merges_-p_--first-parent_main renamed from t/t4013/diff.log_--diff-merges=off_-p_--first-parent_master +1 -1
similarity index 95%
rename from t/t4013/diff.log_--diff-merges=off_-p_--first-parent_master
rename to t/t4013/diff.log_--no-diff-merges_-p_--first-parent_main
index 194e893c94..0b54118088 100644
@@ -1,4 +1,4 @@
-$ git log --diff-merges=off -p --first-parent master
+$ git log --no-diff-merges -p --first-parent main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--patch-with-stat_--summary_main_--_dir_ renamed from t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_ +1 -1
similarity index 96%
rename from t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_
rename to t/t4013/diff.log_--patch-with-stat_--summary_main_--_dir_
index a18f1472a9..3ed46cc867 100644
@@ -1,4 +1,4 @@
-$ git log --patch-with-stat --summary master -- dir/
+$ git log --patch-with-stat --summary main -- dir/
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--patch-with-stat_main renamed from t/t4013/diff.log_--patch-with-stat_master +1 -1
similarity index 98%
rename from t/t4013/diff.log_--patch-with-stat_master
rename to t/t4013/diff.log_--patch-with-stat_main
index ae425c4672..2e12b557cb 100644
@@ -1,4 +1,4 @@
-$ git log --patch-with-stat master
+$ git log --patch-with-stat main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--patch-with-stat_main_--_dir_ renamed from t/t4013/diff.log_--patch-with-stat_master_--_dir_ +1 -1
similarity index 96%
rename from t/t4013/diff.log_--patch-with-stat_master_--_dir_
rename to t/t4013/diff.log_--patch-with-stat_main_--_dir_
index d5207cadf4..d511ea7f6b 100644
@@ -1,4 +1,4 @@
-$ git log --patch-with-stat master -- dir/
+$ git log --patch-with-stat main -- dir/
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_main renamed from t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master +1 -1
similarity index 98%
rename from t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master
rename to t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_main
index 0fc1e8cd71..3cfd0e6422 100644
@@ -1,4 +1,4 @@
-$ git log --root --cc --patch-with-stat --summary master
+$ git log --root --cc --patch-with-stat --summary main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--root_--patch-with-stat_--summary_main renamed from t/t4013/diff.log_--root_--patch-with-stat_--summary_master +1 -1
similarity index 98%
rename from t/t4013/diff.log_--root_--patch-with-stat_--summary_master
rename to t/t4013/diff.log_--root_--patch-with-stat_--summary_main
index dffc09dde9..9f4d6dfa44 100644
@@ -1,4 +1,4 @@
-$ git log --root --patch-with-stat --summary master
+$ git log --root --patch-with-stat --summary main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--root_--patch-with-stat_main renamed from t/t4013/diff.log_--root_--patch-with-stat_master +1 -1
similarity index 98%
rename from t/t4013/diff.log_--root_--patch-with-stat_master
rename to t/t4013/diff.log_--root_--patch-with-stat_main
index 55aa98012d..0d69ae2e11 100644
@@ -1,4 +1,4 @@
-$ git log --root --patch-with-stat master
+$ git log --root --patch-with-stat main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_main renamed from t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master +1 -1
similarity index 98%
rename from t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master
rename to t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_main
index 019d85f7de..1b71add9de 100644
@@ -1,4 +1,4 @@
-$ git log --root -c --patch-with-stat --summary master
+$ git log --root -c --patch-with-stat --summary main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--root_-p_main renamed from t/t4013/diff.log_--root_-p_master +1 -1
similarity index 98%
rename from t/t4013/diff.log_--root_-p_master
rename to t/t4013/diff.log_--root_-p_main
index b42c334439..04581296ed 100644
@@ -1,4 +1,4 @@
-$ git log --root -p master
+$ git log --root -p main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_--root_main renamed from t/t4013/diff.log_--root_master +1 -1
similarity index 96%
rename from t/t4013/diff.log_--root_master
rename to t/t4013/diff.log_--root_main
index e8f46159da..d5e90fd6b4 100644
@@ -1,4 +1,4 @@
-$ git log --root master
+$ git log --root main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_-GF_-p_--pickaxe-all_main renamed from t/t4013/diff.log_-GF_-p_--pickaxe-all_master +1 -1
similarity index 90%
rename from t/t4013/diff.log_-GF_-p_--pickaxe-all_master
rename to t/t4013/diff.log_-GF_-p_--pickaxe-all_main
index d36f88098b..1f7a497c2d 100644
@@ -1,4 +1,4 @@
-$ git log -GF -p --pickaxe-all master
+$ git log -GF -p --pickaxe-all main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.log_-GF_-p_main renamed from t/t4013/diff.log_-GF_-p_master +1 -1
similarity index 91%
rename from t/t4013/diff.log_-GF_-p_master
rename to t/t4013/diff.log_-GF_-p_main
index 9d93f2c23a..c80dda41e9 100644
@@ -1,4 +1,4 @@
-$ git log -GF -p master
+$ git log -GF -p main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.log_-GF_main renamed from t/t4013/diff.log_-SF_master +1 -1
similarity index 86%
rename from t/t4013/diff.log_-SF_master
rename to t/t4013/diff.log_-GF_main
index c1599f2f52..b94a7f7839 100644
@@ -1,4 +1,4 @@
-$ git log -SF master
+$ git log -GF main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.log_-SF_-p_main renamed from t/t4013/diff.log_-SF_-p_master +1 -1
similarity index 91%
rename from t/t4013/diff.log_-SF_-p_master
rename to t/t4013/diff.log_-SF_-p_main
index 5e32438972..fa82ac1490 100644
@@ -1,4 +1,4 @@
-$ git log -SF -p master
+$ git log -SF -p main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.log_-SF_main renamed from t/t4013/diff.log_-GF_master +1 -1
similarity index 86%
rename from t/t4013/diff.log_-GF_master
rename to t/t4013/diff.log_-SF_main
index 4c6708d2d0..dbf770db49 100644
@@ -1,4 +1,4 @@
-$ git log -GF master
+$ git log -SF main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.log_-SF_main_--max-count=0 new file +2 -0
new file mode 100644
index 0000000000..683b17eb99
@@ -0,0 +1,2 @@
+$ git log -SF main --max-count=0
+$
t/t4013/diff.log_-SF_main_--max-count=1 renamed from t/t4013/diff.log_-SF_master_--max-count=2 +1 -1
similarity index 79%
rename from t/t4013/diff.log_-SF_master_--max-count=2
rename to t/t4013/diff.log_-SF_main_--max-count=1
index a6c55fd482..2102426f8c 100644
@@ -1,4 +1,4 @@
-$ git log -SF master --max-count=2
+$ git log -SF main --max-count=1
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.log_-SF_main_--max-count=2 new file +7 -0
new file mode 100644
index 0000000000..23e12a4cbb
@@ -0,0 +1,7 @@
+$ git log -SF main --max-count=2
+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
+Author: A U Thor <[email protected]>
+Date:   Mon Jun 26 00:02:00 2006 +0000
+
+    Third
+$
t/t4013/diff.log_-SF_master_--max-count=0 deleted +0 -2
deleted file mode 100644
index c1fc6c8731..0000000000
@@ -1,2 +0,0 @@
-$ git log -SF master --max-count=0
-$
t/t4013/diff.log_-SF_master_--max-count=1 deleted +0 -7
deleted file mode 100644
index c981a03814..0000000000
@@ -1,7 +0,0 @@
-$ git log -SF master --max-count=1
-commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
-Author: A U Thor <[email protected]>
-Date:   Mon Jun 26 00:02:00 2006 +0000
-
-    Third
-$
t/t4013/diff.log_-S_F_main renamed from t/t4013/diff.log_-S_F_master +1 -1
similarity index 86%
rename from t/t4013/diff.log_-S_F_master
rename to t/t4013/diff.log_-S_F_main
index 978d2b4118..a75a42e143 100644
@@ -1,4 +1,4 @@
-$ git log -S F master
+$ git log -S F main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.log_-m_-p_--first-parent_main renamed from t/t4013/diff.log_-m_-p_--first-parent_master +1 -1
similarity index 97%
rename from t/t4013/diff.log_-m_-p_--first-parent_master
rename to t/t4013/diff.log_-m_-p_--first-parent_main
index 7a0073f529..459e10786b 100644
@@ -1,4 +1,4 @@
-$ git log -m -p --first-parent master
+$ git log -m -p --first-parent main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_-m_-p_main renamed from t/t4013/diff.log_-m_-p_master +1 -1
similarity index 99%
rename from t/t4013/diff.log_-m_-p_master
rename to t/t4013/diff.log_-m_-p_main
index 9ca62a01ed..07453c5698 100644
@@ -1,4 +1,4 @@
-$ git log -m -p master
+$ git log -m -p main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (from 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0)
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_-p_--first-parent_main renamed from t/t4013/diff.log_-p_--first-parent_master +1 -1
similarity index 97%
rename from t/t4013/diff.log_-p_--first-parent_master
rename to t/t4013/diff.log_-p_--first-parent_main
index 28840ebea1..247980817b 100644
@@ -1,4 +1,4 @@
-$ git log -p --first-parent master
+$ git log -p --first-parent main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_-p_main renamed from t/t4013/diff.log_-p_master +1 -1
similarity index 98%
rename from t/t4013/diff.log_-p_master
rename to t/t4013/diff.log_-p_main
index bf1326dc36..c82b4dbf16 100644
@@ -1,4 +1,4 @@
-$ git log -p master
+$ git log -p main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.log_main renamed from t/t4013/diff.log_master +1 -1
similarity index 97%
rename from t/t4013/diff.log_master
rename to t/t4013/diff.log_main
index a8f6ce5abd..50401f73e6 100644
@@ -1,4 +1,4 @@
-$ git log master
+$ git log main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.noellipses-diff-tree_-c_--abbrev_main renamed from t/t4013/diff.noellipses-diff-tree_-c_--abbrev_master +1 -1
similarity index 81%
rename from t/t4013/diff.noellipses-diff-tree_-c_--abbrev_master
rename to t/t4013/diff.noellipses-diff-tree_-c_--abbrev_main
index bb80f013b3..3aa1f80af3 100644
@@ -1,4 +1,4 @@
-$ git diff-tree -c --abbrev master
+$ git diff-tree -c --abbrev main
 59d314ad6f356dd08601a4cd5e530381da3e3c64
 ::100644 100644 100644 cead32e 7289e35 992913c MM	dir/sub
 ::100644 100644 100644 b414108 f4615da 10a8a9f MM	file0
t/t4013/diff.noellipses-whatchanged_--root_main renamed from t/t4013/diff.noellipses-whatchanged_--root_master +1 -1
similarity index 96%
rename from t/t4013/diff.noellipses-whatchanged_--root_master
rename to t/t4013/diff.noellipses-whatchanged_--root_main
index c2cfd4e729..2bec055835 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --root master
+$ git whatchanged --root main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.noellipses-whatchanged_-SF_main renamed from t/t4013/diff.noellipses-whatchanged_-SF_master +1 -1
similarity index 86%
rename from t/t4013/diff.noellipses-whatchanged_-SF_master
rename to t/t4013/diff.noellipses-whatchanged_-SF_main
index b36ce5886e..0c1476d19e 100644
@@ -1,4 +1,4 @@
-$ git whatchanged -SF master
+$ git whatchanged -SF main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.noellipses-whatchanged_main renamed from t/t4013/diff.noellipses-whatchanged_master +1 -1
similarity index 96%
rename from t/t4013/diff.noellipses-whatchanged_master
rename to t/t4013/diff.noellipses-whatchanged_main
index 55e500f2ed..c48d2851aa 100644
@@ -1,4 +1,4 @@
-$ git whatchanged master
+$ git whatchanged main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.show_--first-parent_main renamed from t/t4013/diff.show_--first-parent_master +1 -1
similarity index 92%
rename from t/t4013/diff.show_--first-parent_master
rename to t/t4013/diff.show_--first-parent_main
index 3dcbe473a0..480502d65c 100644
@@ -1,4 +1,4 @@
-$ git show --first-parent master
+$ git show --first-parent main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.show_-c_main renamed from t/t4013/diff.show_-c_master +1 -1
similarity index 95%
rename from t/t4013/diff.show_-c_master
rename to t/t4013/diff.show_-c_main
index 81aba8da96..74ef8bc96b 100644
@@ -1,4 +1,4 @@
-$ git show -c master
+$ git show -c main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.show_-m_main renamed from t/t4013/diff.show_-m_master +1 -1
similarity index 98%
rename from t/t4013/diff.show_-m_master
rename to t/t4013/diff.show_-m_main
index 4ea2ee453d..8fd56736d9 100644
@@ -1,4 +1,4 @@
-$ git show -m master
+$ git show -m main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (from 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0)
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.show_main renamed from t/t4013/diff.show_master +1 -1
similarity index 96%
rename from t/t4013/diff.show_master
rename to t/t4013/diff.show_main
index fb08ce0e46..630b52a95e 100644
@@ -1,4 +1,4 @@
-$ git show master
+$ git show main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.whatchanged_--patch-with-stat_--summary_main_--_dir_ renamed from t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ +1 -1
similarity index 94%
rename from t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_
rename to t/t4013/diff.whatchanged_--patch-with-stat_--summary_main_--_dir_
index c8b6af2f43..ce0754d556 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --patch-with-stat --summary master -- dir/
+$ git whatchanged --patch-with-stat --summary main -- dir/
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.whatchanged_--patch-with-stat_main renamed from t/t4013/diff.whatchanged_--patch-with-stat_master +1 -1
similarity index 97%
rename from t/t4013/diff.whatchanged_--patch-with-stat_master
rename to t/t4013/diff.whatchanged_--patch-with-stat_main
index 1ac431ba92..aabccf39a5 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --patch-with-stat master
+$ git whatchanged --patch-with-stat main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.whatchanged_--patch-with-stat_main_--_dir_ renamed from t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_ +1 -1
similarity index 94%
rename from t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_
rename to t/t4013/diff.whatchanged_--patch-with-stat_main_--_dir_
index b30c28588f..c05a0e8149 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --patch-with-stat master -- dir/
+$ git whatchanged --patch-with-stat main -- dir/
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_main renamed from t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master +1 -1
similarity index 97%
rename from t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master
rename to t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_main
index 30aae7817b..1f74b1b548 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --root --cc --patch-with-stat --summary master
+$ git whatchanged --root --cc --patch-with-stat --summary main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_main renamed from t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master +1 -1
similarity index 97%
rename from t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master
rename to t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_main
index db90e51525..80d9812151 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --root --patch-with-stat --summary master
+$ git whatchanged --root --patch-with-stat --summary main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.whatchanged_--root_--patch-with-stat_main renamed from t/t4013/diff.whatchanged_--root_--patch-with-stat_master +1 -1
similarity index 97%
rename from t/t4013/diff.whatchanged_--root_--patch-with-stat_master
rename to t/t4013/diff.whatchanged_--root_--patch-with-stat_main
index 9a6cc92ce7..c0b9082a2c 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --root --patch-with-stat master
+$ git whatchanged --root --patch-with-stat main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_main renamed from t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master +1 -1
similarity index 97%
rename from t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master
rename to t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_main
index d1d32bd34c..0002c6912e 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --root -c --patch-with-stat --summary master
+$ git whatchanged --root -c --patch-with-stat --summary main
 commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <[email protected]>
t/t4013/diff.whatchanged_--root_-p_main renamed from t/t4013/diff.whatchanged_--root_-p_master +1 -1
similarity index 98%
rename from t/t4013/diff.whatchanged_--root_-p_master
rename to t/t4013/diff.whatchanged_--root_-p_main
index ebf1f0661e..39f3e2be74 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --root -p master
+$ git whatchanged --root -p main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.whatchanged_--root_main renamed from t/t4013/diff.whatchanged_--root_master +1 -1
similarity index 97%
rename from t/t4013/diff.whatchanged_--root_master
rename to t/t4013/diff.whatchanged_--root_main
index a405cb6138..36f4d6697f 100644
@@ -1,4 +1,4 @@
-$ git whatchanged --root master
+$ git whatchanged --root main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.whatchanged_-SF_-p_main renamed from t/t4013/diff.whatchanged_-SF_-p_master +1 -1
similarity index 89%
rename from t/t4013/diff.whatchanged_-SF_-p_master
rename to t/t4013/diff.whatchanged_-SF_-p_main
index f39da84822..0e2e67c0df 100644
@@ -1,4 +1,4 @@
-$ git whatchanged -SF -p master
+$ git whatchanged -SF -p main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.whatchanged_-SF_main renamed from t/t4013/diff.whatchanged_-SF_master +1 -1
similarity index 86%
rename from t/t4013/diff.whatchanged_-SF_master
rename to t/t4013/diff.whatchanged_-SF_main
index 0499321d0e..34c6bf6b95 100644
@@ -1,4 +1,4 @@
-$ git whatchanged -SF master
+$ git whatchanged -SF main
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:02:00 2006 +0000
t/t4013/diff.whatchanged_-p_main renamed from t/t4013/diff.whatchanged_-p_master +1 -1
similarity index 98%
rename from t/t4013/diff.whatchanged_-p_master
rename to t/t4013/diff.whatchanged_-p_main
index f18d43209c..18f3bdeef4 100644
@@ -1,4 +1,4 @@
-$ git whatchanged -p master
+$ git whatchanged -p main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
t/t4013/diff.whatchanged_main renamed from t/t4013/diff.whatchanged_master +1 -1
similarity index 97%
rename from t/t4013/diff.whatchanged_master
rename to t/t4013/diff.whatchanged_main
index cd3bcc2c72..d6c83ed8b0 100644
@@ -1,4 +1,4 @@
-$ git whatchanged master
+$ git whatchanged main
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <[email protected]>
 Date:   Mon Jun 26 00:03:00 2006 +0000
Signature · 1 line
gitgitgadget
#20 lore raw

PATCH 9/10 tests: prepare aligned mentions of the default branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

In some tests, the default branch name is part of aligned output. As we want to change the default branch name to main, which is two characters shorter than the old default branch name, we will have to adjust those tests.

Since we use the original default branch name until the entire test suite has been adjusted accordingly, the touched test cases need to be guarded by a prereq (that is so far disabled so that they are skipped for now).

The test cases that depend on those test cases that are newly guarded by that prereq naturally have to be guarded, too.

---
 t/t3200-branch.sh              | 12 +++---
 t/t3201-branch-contains.sh     |  8 ++--
 t/t3203-branch-output.sh       |  4 +-
 t/t3205-branch-color.sh        |  8 ++--
 t/t5505-remote.sh              | 30 +++++++--------
 t/t5510-fetch.sh               |  8 ++--
 t/t5526-fetch-submodules.sh    | 70 +++++++++++++++++-----------------
 t/t6302-for-each-ref-filter.sh | 24 ++++++------
 8 files changed, 82 insertions(+), 82 deletions(-)
t/t3200-branch.sh +6 -6
index 55b24b76ce..a0b832d59e 100755
@@ -321,11 +321,11 @@ test_expect_success 'git branch --list -v with --abbrev' '
 
 '
 
-test_expect_success 'git branch --column' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expect <<\EOF &&
-  a/b/c    bam      foo      l      * master   n        o/p      r
-  abc      bar      j/k      m/m      mb       o/o      q        topic
+  a/b/c   bam     foo     l     * main    n       o/p     r
+  abc     bar     j/k     m/m     mb      o/o     q       topic
 EOF
 	test_cmp expect actual
 '
@@ -358,15 +358,15 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success 'git branch with column.*' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
 	git config column.ui column &&
 	git config column.branch "dense" &&
 	COLUMNS=80 git branch >actual &&
 	git config --unset column.branch &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
-  a/b/c   bam   foo   l   * master   n     o/p   r
-  abc     bar   j/k   m/m   mb       o/o   q     topic
+  a/b/c   bam   foo   l   * main   n     o/p   r
+  abc     bar   j/k   m/m   mb     o/o   q     topic
 EOF
 	test_cmp expect actual
 '
t/t3201-branch-contains.sh +4 -4
index efea5c4971..3733cd0091 100755
@@ -242,7 +242,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # Here "topic" tracks "master" with one extra commit, and "zzz" points to the
 # same tip as master The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
-test_expect_success 'branch --merged with --verbose' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
 	git branch --track topic master &&
 	git branch zzz topic &&
 	git checkout topic &&
@@ -256,9 +256,9 @@ test_expect_success 'branch --merged with --verbose' '
 	test_cmp expect actual &&
 	git branch --verbose --merged topic >actual &&
 	cat >expect <<-EOF &&
-	  master $(git rev-parse --short master) second on master
-	* topic  $(git rev-parse --short topic ) [ahead 1] foo
-	  zzz    $(git rev-parse --short zzz   ) second on master
+	  main  $(git rev-parse --short main) second on main
+	* topic $(git rev-parse --short topic ) [ahead 1] foo
+	  zzz   $(git rev-parse --short zzz   ) second on main
 	EOF
 	test_i18ncmp expect actual
 '
t/t3203-branch-output.sh +2 -2
index 71818b90f0..d65586541d 100755
@@ -329,7 +329,7 @@ test_expect_success '--color overrides auto-color' '
 	test_cmp expect.color actual
 '
 
-test_expect_success 'verbose output lists worktree path' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
 	one=$(git rev-parse --short HEAD) &&
 	two=$(git rev-parse --short master) &&
 	cat >expect <<-EOF &&
@@ -337,7 +337,7 @@ test_expect_success 'verbose output lists worktree path' '
 	  ambiguous                    $one one
 	  branch-one                   $two two
 	+ branch-two                   $one ($(pwd)/worktree_dir) one
-	  master                       $two two
+	  main                         $two two
 	  ref-to-branch                $two two
 	  ref-to-remote                $two two
 	EOF
t/t3205-branch-color.sh +4 -4
index 4f1e16bb44..289625c464 100755
@@ -28,12 +28,12 @@ test_expect_success 'regular output shows colors' '
 	test_cmp expect actual
 '
 
-test_expect_success 'verbose output shows colors' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
 	oid=$(git rev-parse --short HEAD) &&
 	cat >expect <<-EOF &&
-	* <CYAN>master               <RESET> $oid foo
-	  <BLUE>other                <RESET> $oid foo
-	  <YELLOW>remotes/origin/master<RESET> $oid foo
+	* <CYAN>main               <RESET> $oid foo
+	  <BLUE>other              <RESET> $oid foo
+	  <YELLOW>remotes/origin/main<RESET> $oid foo
 	EOF
 	git branch --color -v -a >actual.raw &&
 	test_decode_color <actual.raw >actual &&
t/t5505-remote.sh +15 -15
index 8d62edd98b..de0e3df14a 100755
@@ -200,28 +200,28 @@ cat >test/expect <<EOF
   Push  URL: $(pwd)/one
   HEAD branch: master
   Remote branches:
-    master new (next fetch will store in remotes/origin)
-    side   tracked
+    main new (next fetch will store in remotes/origin)
+    side tracked
   Local branches configured for 'git pull':
-    ahead    merges with remote master
-    master   merges with remote master
+    ahead    merges with remote main
+    main     merges with remote main
     octopus  merges with remote topic-a
                 and with remote topic-b
                 and with remote topic-c
     rebase  rebases onto remote master
   Local refs configured for 'git push':
-    master pushes to master   (local out of date)
-    master pushes to upstream (create)
+    main pushes to main     (local out of date)
+    main pushes to upstream (create)
 * remote two
   Fetch URL: ../two
   Push  URL: ../three
   HEAD branch: master
   Local refs configured for 'git push':
-    ahead  forces to master  (fast-forwardable)
-    master pushes to another (up to date)
+    ahead forces to main    (fast-forwardable)
+    main  pushes to another (up to date)
 EOF
 
-test_expect_success 'show' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
 	(
 		cd test &&
 		git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
@@ -264,15 +264,15 @@ cat >test/expect <<EOF
     master
     side
   Local branches configured for 'git pull':
-    ahead  merges with remote master
-    master merges with remote master
+    ahead merges with remote main
+    main  merges with remote main
   Local refs configured for 'git push' (status not queried):
     (matching)           pushes to (matching)
-    refs/heads/master    pushes to refs/heads/upstream
+    refs/heads/main      pushes to refs/heads/upstream
     refs/tags/lastbackup forces to refs/tags/lastbackup
 EOF
 
-test_expect_success 'show -n' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
 	mv one one.unreachable &&
 	(
 		cd test &&
@@ -315,7 +315,7 @@ test_expect_success 'set-head --auto' '
 	)
 '
 
-test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
 	(
 		cd test &&
 		git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1335,7 +1335,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 	)
 '
 
-test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
 	(
 		cd two &&
 		git tag -a -m "Some tag" my-tag master &&
t/t5510-fetch.sh +4 -4
index dbc724e4c0..5d673358f9 100755
@@ -942,7 +942,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
 	)
 '
 
-test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
 	git clone . full-output &&
 	test_commit looooooooooooong-tag &&
 	(
@@ -951,13 +951,13 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
 		grep -e "->" actual | cut -c 22- >../actual
 	) &&
 	cat >expect <<-\EOF &&
-	master               -> origin/master
+	main                 -> origin/main
 	looooooooooooong-tag -> looooooooooooong-tag
 	EOF
 	test_cmp expect actual
 '
 
-test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
 	git clone . compact &&
 	test_commit extraaa &&
 	(
@@ -966,7 +966,7 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
 		grep -e "->" actual | cut -c 22- >../actual
 	) &&
 	cat >expect <<-\EOF &&
-	master     -> origin/*
+	main       -> origin/*
 	extraaa    -> *
 	EOF
 	test_cmp expect actual
t/t5526-fetch-submodules.sh +35 -35

279 lines not on this page · raw message

t/t6302-for-each-ref-filter.sh +12 -12
index 781e470aea..0a21669f56 100755
@@ -113,9 +113,9 @@ test_expect_success '%(color) must fail' '
 	test_must_fail git for-each-ref --format="%(color)%(refname)"
 '
 
-test_expect_success 'left alignment is default' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
 	cat >expect <<-\EOF &&
-	refname is refs/heads/master  |refs/heads/master
+	refname is refs/heads/main    |refs/heads/main
 	refname is refs/heads/side    |refs/heads/side
 	refname is refs/odd/spot      |refs/odd/spot
 	refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -131,9 +131,9 @@ test_expect_success 'left alignment is default' '
 	test_cmp expect actual
 '
 
-test_expect_success 'middle alignment' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
 	cat >expect <<-\EOF &&
-	| refname is refs/heads/master |refs/heads/master
+	|  refname is refs/heads/main  |refs/heads/main
 	|  refname is refs/heads/side  |refs/heads/side
 	|   refname is refs/odd/spot   |refs/odd/spot
 	|refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -149,9 +149,9 @@ test_expect_success 'middle alignment' '
 	test_cmp expect actual
 '
 
-test_expect_success 'right alignment' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' '
 	cat >expect <<-\EOF &&
-	|  refname is refs/heads/master|refs/heads/master
+	|    refname is refs/heads/main|refs/heads/main
 	|    refname is refs/heads/side|refs/heads/side
 	|      refname is refs/odd/spot|refs/odd/spot
 	|refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -168,7 +168,7 @@ test_expect_success 'right alignment' '
 '
 
 cat >expect <<-\EOF
-|       refname is refs/heads/master       |refs/heads/master
+|        refname is refs/heads/main        |refs/heads/main
 |        refname is refs/heads/side        |refs/heads/side
 |         refname is refs/odd/spot         |refs/odd/spot
 |    refname is refs/tags/annotated-tag    |refs/tags/annotated-tag
@@ -184,7 +184,7 @@ EOF
 test_align_permutations() {
 	while read -r option
 	do
-		test_expect_success "align:$option" '
+		test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" '
 			git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual &&
 			test_cmp expect actual
 		'
@@ -213,9 +213,9 @@ EOF
 
 # Individual atoms inside %(align:...) and %(end) must not be quoted.
 
-test_expect_success 'alignment with format quote' "
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
 	cat >expect <<-\EOF &&
-	|'      '\''master| A U Thor'\''      '|
+	|'       '\''main| A U Thor'\''       '|
 	|'       '\''side| A U Thor'\''       '|
 	|'     '\''odd/spot| A U Thor'\''     '|
 	|'      '\''annotated-tag| '\''       '|
@@ -231,9 +231,9 @@ test_expect_success 'alignment with format quote' "
 	test_cmp expect actual
 "
 
-test_expect_success 'nested alignment with quote formatting' "
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' "
 	cat >expect <<-\EOF &&
-	|'         master               '|
+	|'           main               '|
 	|'           side               '|
 	|'       odd/spot               '|
 	|'  annotated-tag               '|
Signature · 1 line
gitgitgadget
#19 lore raw

PATCH 8/10 t9902: prepare a test for the upcoming default branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

We need to adjust a test that uses a prefix of the default branch name, to accommodate for main being used soon.

---
 t/t9902-completion.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/t9902-completion.sh +3 -3
index 7b7bc6e4bd..0badcf829b 100755
@@ -1055,13 +1055,13 @@ test_expect_success 'teardown after filtering matching refs' '
 	git -C otherrepo branch -D matching/branch-in-other
 '
 
-test_expect_success '__git_refs - for-each-ref format specifiers in prefix' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH '__git_refs - for-each-ref format specifiers in prefix' '
 	cat >expected <<-EOF &&
 	evil-%%-%42-%(refname)..master
 	EOF
 	(
-		cur="evil-%%-%42-%(refname)..mas" &&
-		__git_refs "" "" "evil-%%-%42-%(refname).." mas >"$actual"
+		cur="evil-%%-%42-%(refname)..mai" &&
+		__git_refs "" "" "evil-%%-%42-%(refname).." mai >"$actual"
 	) &&
 	test_cmp expected "$actual"
 '
Signature · 1 line
gitgitgadget
#21 lore raw

PATCH 10/10 t1400: prepare for `main` being default branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

In addition to the trivial search-and-replace, there are three non-trivial adjustments necessary.

Mark the respective test cases with the transitional prereq and make those non-trivial adjustments early, to make this change easier to review.

---
 t/t1400-update-ref.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
t/t1400-update-ref.sh +5 -5
index 770e7be363..4c01e08551 100755
@@ -585,10 +585,10 @@ test_expect_success 'stdin fails on unbalanced quotes' '
 	grep "fatal: badly quoted argument: \\\"master" err
 '
 
-test_expect_success 'stdin fails on invalid escape' '
-	echo "create $a \"ma\zter\"" >stdin &&
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
+	echo "create $a \"ma\zn\"" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	grep "fatal: badly quoted argument: \\\"ma\\\\zter\\\"" err
+	grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
 '
 
 test_expect_success 'stdin fails on junk after quoted argument' '
@@ -704,9 +704,9 @@ test_expect_success 'stdin succeeds with quoted argument' '
 	test_cmp expect actual
 '
 
-test_expect_success 'stdin succeeds with escaped character' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
 	git update-ref -d $a &&
-	echo "create $a \"ma\\163ter\"" >stdin &&
+	echo "create $a \"ma\\151n\"" >stdin &&
 	git update-ref --stdin <stdin &&
 	git rev-parse $m >expect &&
 	git rev-parse $a >actual &&
Signature · 1 line
gitgitgadget
#22 lore raw
In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 10 lines · writes:

In preparation for changing the default of init.defaultBranch to main, here are a couple of manual adjustments that cannot be automated (i.e., these adjustments are not mere search-and-replaces).

This patch series is based on js/default-branch-name-part-3, and is part of the larger effort tracked at https://github.com/gitgitgadget/git/pull/655.

The next patch series will be largely automated search-and-replaces; Obviously, the search-and-replace was the easy part, the manual inspection whether the changes are actually correct was much more involved.

Yes. That's always the pain-point of a tree-wide change like this.

Quoted 5 lines

What to expect next, after this patch series? Essentially, there is the large patch series that adjusts the entire test suite, with two patch series extracted from that effort: t5411 and t5515 simply require too large patches, and will therefore be presented as the next patch series after this one.

This one is already a bit too ambitious in that it collides with stuff in flight, by the way.

#2 lore raw

Re: [PATCH 01/10] fmt-merge-msg: also suppress "into main" by default

In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 4 lines · writes:

From: Johannes Schindelin <[email protected]>

In preparation for changing the default branch name to main, let's skip the suffix "into main" in merge commit messages.

Hmph, we reversed the course from "no suppression" to "suppress master as we've always done" because otherwise we'd add _more_ instances of 6-letter string 'master' to our codebase, and that was to be avoided. There is no such "let's avoid saying main" desire, is there?

I can see why a series about updating tests would want a change like this (i.e. to avoid patches that have to add 'into main' everywhere to the expected output), but as to the desired behaviour of the default behaviour of "git merge" command, I am not sure this goes into the right direction. After all, there are those (including me) who find the idea of having one single thing (in this case a branch) that is special among others is objectionable in itself, not what word (e.g. 'master') is used to call that single "special" thing.

Having said all that, let me keep my suggested change to the very minimum. Let's end the proposed log message with

..., let's skip the suffix "into main" in merge commit messages, the same way that "into master" has been skipped by default.

That would justify why we are still special casing the new word.

Thanks.

Quoted 20 lines
---
 fmt-merge-msg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fmt-merge-msg.c +3 -1
index bd22e1ea88..9a664a4a58 100644
@@ -626,8 +626,10 @@ int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
 	void *current_branch_to_free;
 	struct merge_parents merge_parents;
 
-	if (!suppress_dest_pattern_seen)
+	if (!suppress_dest_pattern_seen) {
+		string_list_append(&suppress_dest_patterns, "main");
 		string_list_append(&suppress_dest_patterns, "master");
+	}
 
 	memset(&merge_parents, 0, sizeof(merge_parents));
#5 lore raw

Re: [PATCH 02/10] t9801: use `--` in preparation for default branch rename

In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 6 lines · writes:

From: Johannes Schindelin <[email protected]>

Seeing as we want to use main as the new default branch name used by git init, and that main is used as directory name in t9801, let's tighten the rev-list arguments to make it explicit when we are referring to a ref instead of a directory.

Interesting. s/master/main/g would introduce "that name is both a revision and a path" ambiguity? An obvious alternative would be to use a word that is not 'main' or 'master' for the path and that way we will keep the current property that tests do not have to worry about the rev/path ambiguity. But given that even "git p4" should be safe against rev/path ambiguity, I think this is good in the long run---if "git p4" is not prepared to handle the ambiguity correctly, then this approach may reveal such an existing breakage when the branch name 'master' is replaced with 'main', and at that point, we have to scramble and fix it (or rename the path from 'main' to something else as a workaround).

Looking good.

#7 lore raw

Re: [PATCH 03/10] tests: start moving to a different default main branch name

In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 6 lines · writes:

Note: the GIT_TEST_DEFAULT_MAIN_BRANCH_NAME is _not_ intended to be used manually; many tests require a specific main branch name and cannot simply work with another one. This GIT_TEST_* variable is meant purely for the transitional period while the entire test suite is converted to use main as the initial branch name by default.

Quoted 6 lines

We also introduce the PREPARE_FOR_MAIN_BRANCH prereq that determines whether the default main branch name is main, and adjust a couple of test functions to use it. This prereq will be used to temporarily disable a couple test cases to allow for adjusting the test script incrementally. Once an entire test is adjusted, we will adjust the test so that it is run with GIT_TEST_DEFAULT_MAIN_BRANCH_NAME=main.

Good transition plan. The name of the environment variable itself serves as markers that remind us where we need to update once the conversion is done, so there is no need to leave NEEDSWORK comment, either.

Nicely done.

#9 lore raw

Re: [PATCH 04/10] t4013: prepare for the new default branch name "main"

In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 6 lines · writes:

From: Johannes Schindelin <[email protected]>

This patch is a bit involved, mainly because the default branch name is not only hard-coded in the script t4013-diff-various.sh itself, and not only in the support files in t/t4013/, but also in the _file names_ in t/t4013/.

There are some stuff in flight; let's hold this step before they graduate to avoid clashing.

#12 lore raw

Re: [PATCH 05/10] t6200: adjust suppression pattern to also match "main"

In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

t/t6200-fmt-merge-msg.sh test_expect_success 'merge.suppressDest configuration' ' · line 559

Quoted 2 lines · writes:
t/t6200-fmt-merge-msg.sh +1 -1
-	git -c merge.suppressDest="ma??er" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
+	git -c merge.suppressDest="ma*" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&

Cute. IIRC, the point of this test was to ensure that a glob pattern works, so we can do a bit better to avoid colliding with another common name 'maint' by tightening the pattern to something like "ma?*[rn]".

#15 lore raw

Re: [PATCH 06/10] t5703: adjust a test case for the upcoming default branch name

In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 8 lines · writes:

From: Johannes Schindelin <[email protected]>

We want to rename the default branch name used by git init in the near future, using main as the new name.

In preparation for that, we adjust a test case that wants to rename the default branch to a different name that however has the same length. We use none as that name because it matches the length of main.

The original chose word that not only is the same length but is similarly spell (master vs raster). Perhaps mirroring that arrangement and picking 'rain' would have been even a better taste, but this is good enough ;-)

The test pieces in this script seem to be arranged to be mostly independent from each other, and especially because this one is at the end of the script, making it run only when 'main' is in use, and skipping otherwise, would not hurt anybody else. We just need to make sure that nobody adds new tests after this one that may be affected by the allowRefInWant configuration setting.

Looking good.

Thanks.

Quoted 14 lines
t/t5703-upload-pack-ref-in-want.sh +3 -3
-test_expect_success 'server loses a ref - ref in want' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	echo "s/master/raster/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
+	echo "s/main/none/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
 	test_must_fail git -C local fetch 2>err &&
 
-	test_i18ngrep "fatal: remote error: unknown ref refs/heads/raster" err
+	test_i18ngrep "fatal: remote error: unknown ref refs/heads/none" err
 '
 
 # DO NOT add non-httpd-specific tests here, because the last part of this
#17 lore raw

Re: [PATCH 07/10] t3200: prepare for `main` being shorter than `master`

In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 7 lines · writes:

From: Johannes Schindelin <[email protected]>

In the test case adjusted by this patch, we want to cut just after the longest shown ref name. Since main is shorter than master, we need to decrease the number of characters. Since main2 is shown, too, and since that is only one character shorter than master, we decrement the length by one.

Confused. I do not see 'main2' (or 'master2' for that matter) in the test script.

If we rename 'topic' to 'topico', then we'd still show branches, the longest among which has 6 characters (the same as 'master'), so we won't have to wonder where 'main2' came from; I guess that is another way to solve this.

Quoted 22 lines
---
 t/t3200-branch.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
t/t3200-branch.sh +2 -2
index 6efe7a44bc..55b24b76ce 100755
@@ -375,9 +375,9 @@ test_expect_success 'git branch --column -v should fail' '
 	test_must_fail git branch --column -v
 '
 
-test_expect_success 'git branch -v with column.ui ignored' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
-	COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
+	COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
   a/b/c
#10 lore raw

Re: [PATCH 04/10] t4013: prepare for the new default branch name "main"

In reply to Junio C Hamano

Hi Junio,

Quoted 5 lines · Junio C Hamano

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 2 lines · writes:

From: Johannes Schindelin <[email protected]>

Quoted 7 lines
Quoted 4 lines

This patch is a bit involved, mainly because the default branch name is not only hard-coded in the script t4013-diff-various.sh itself, and not only in the support files in t/t4013/, but also in the _file names_ in t/t4013/.

There are some stuff in flight; let's hold this step before they graduate to avoid clashing.

Fair enough. I described the commands I ran to bring this patch about, and I can just as easily run the same commands once the dust settled a bit.

Thanks,
Dscho

#3 lore raw

Re: [PATCH 01/10] fmt-merge-msg: also suppress "into main" by default

In reply to Junio C Hamano

Hi Junio,

Quoted 14 lines · Junio C Hamano

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 4 lines · writes:

From: Johannes Schindelin <[email protected]>

In preparation for changing the default branch name to main, let's skip the suffix "into main" in merge commit messages.

Hmph, we reversed the course from "no suppression" to "suppress master as we've always done" because otherwise we'd add _more_ instances of 6-letter string 'master' to our codebase, and that was to be avoided. There is no such "let's avoid saying main" desire, is there?

Quoted 8 lines

I can see why a series about updating tests would want a change like this (i.e. to avoid patches that have to add 'into main' everywhere to the expected output), but as to the desired behaviour of the default behaviour of "git merge" command, I am not sure this goes into the right direction. After all, there are those (including me) who find the idea of having one single thing (in this case a branch) that is special among others is objectionable in itself, not what word (e.g. 'master') is used to call that single "special" thing.

The reason I did it this way is to benefit from a straight-forward s/master/main/g...

Quoted 7 lines

Having said all that, let me keep my suggested change to the very minimum. Let's end the proposed log message with

..., let's skip the suffix "into main" in merge commit messages, the same way that "into master" has been skipped by default.

That would justify why we are still special casing the new word.

I changed it this way.

Thanks,
Dscho

#13 lore raw

Re: [PATCH 05/10] t6200: adjust suppression pattern to also match "main"

In reply to Junio C Hamano

Hi Junio,

Quoted 10 lines · Junio C Hamano

"Johannes Schindelin via GitGitGadget" <[email protected]>

t/t6200-fmt-merge-msg.sh test_expect_success 'merge.suppressDest configuration' ' · line 559

Quoted 2 lines · writes:
t/t6200-fmt-merge-msg.sh +1 -1
-	git -c merge.suppressDest="ma??er" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
+	git -c merge.suppressDest="ma*" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&

Cute. IIRC, the point of this test was to ensure that a glob pattern works, so we can do a bit better to avoid colliding with another common name 'maint' by tightening the pattern to something like "ma?*[rn]".

Good idea. I changed it locally.

Ciao,
Dscho

#18 lore raw

Re: [PATCH 07/10] t3200: prepare for `main` being shorter than `master`

In reply to Junio C Hamano

Hi Junio,

Quoted 5 lines · Junio C Hamano

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 2 lines · writes:

From: Johannes Schindelin <[email protected]>

Quoted 8 lines
Quoted 5 lines

In the test case adjusted by this patch, we want to cut just after the longest shown ref name. Since main is shorter than master, we need to decrease the number of characters. Since main2 is shown, too, and since that is only one character shorter than master, we decrement the length by one.

Confused. I do not see 'main2' (or 'master2' for that matter) in the test script.

Oops. Yes, this is a left-over from the time when I had renamed the branches from master2 to main2 (and based on your advice, I had changed those patches to rename to topic instead).

Quoted 4 lines

If we rename 'topic' to 'topico', then we'd still show branches, the longest among which has 6 characters (the same as 'master'), so we won't have to wonder where 'main2' came from; I guess that is another way to solve this.

Sure, but then, that would adjust a perfectly nice name to a not-so-nice name just to avoid changing the number of columns to cut.

If you don't mind, I would like to stay on topic ;-)

Ciao,
Dscho

#23 lore raw
In reply to Junio C Hamano

Hi Junio,

Quoted 7 lines · Junio C Hamano

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 4 lines · writes:

In preparation for changing the default of init.defaultBranch to main, here are a couple of manual adjustments that cannot be automated (i.e., these adjustments are not mere search-and-replaces).

Quoted 8 lines
Quoted 6 lines

This patch series is based on js/default-branch-name-part-3, and is part of the larger effort tracked at https://github.com/gitgitgadget/git/pull/655.

The next patch series will be largely automated search-and-replaces; Obviously, the search-and-replace was the easy part, the manual inspection whether the changes are actually correct was much more involved.

Yes. That's always the pain-point of a tree-wide change like this.

To help with such a huge change, I tried to minimize the manual patches, and wrote the exact shell commands into the non-manual patches. Hopefully this will help us with the transition.

Quoted 8 lines
Quoted 5 lines

What to expect next, after this patch series? Essentially, there is the large patch series that adjusts the entire test suite, with two patch series extracted from that effort: t5411 and t5515 simply require too large patches, and will therefore be presented as the next patch series after this one.

This one is already a bit too ambitious in that it collides with stuff in flight, by the way.

Okay, I will leave out the t4013 changes from this patch series, and re-submit once mk/diff-ignore-regex advances to next.

Thank you for reviewing this patch series,
Dscho

#24 lore raw

v2 cover Prepare for changing the default branch name main (last manual part)

In reply to Johannes Schindelin via GitGitGadget

In preparation for changing the default of init.defaultBranch to main, here are a couple of manual adjustments that cannot be automated (i.e., these adjustments are not mere search-and-replaces).

This patch series is based on js/default-branch-name-part-3, and is part of the larger effort tracked at https://github.com/gitgitgadget/git/pull/655.

The next patch series will be largely automated search-and-replaces; Obviously, the search-and-replace was the easy part, the manual inspection whether the changes are actually correct was much more involved.

What to expect next, after this patch series? Essentially, there is the large patch series that adjusts the entire test suite, with two patch series extracted from that effort: t5411 and t5515 simply require too large patches, and will therefore be presented as the next patch series after this one.

Changes since v1:

* The t4013 patch was moved out of this patch series, to be re-submitted at a later date, to avoid clashing with other patches in seen.
* The commit message of 'fmt-merge-msg: also suppress "into main" by default' was adjusted to mention that we do the same for main as we do for master.
* The t5703 patch now uses rain instead of none, to be closer to the default branch name.
* The glob in t6200 was tightened to avoid matching maint.
* The commit message of 't3200: prepare for main being shorter than master' stopped talking about main2 (which itself was a left-over from a previous iteration of a previous patch series).

Johannes Schindelin (9):
fmt-merge-msg: also suppress "into main" by default
t9801: use -- in preparation for default branch rename
tests: start moving to a different default main branch name
t6200: adjust suppression pattern to also match "main"
t5703: adjust a test case for the upcoming default branch name
t3200: prepare for main being shorter than master
t9902: prepare a test for the upcoming default branch name
tests: prepare aligned mentions of the default branch name
t1400: prepare for main being default branch name

 fmt-merge-msg.c                    |  4 +-
 refs.c                             |  5 ++-
 t/lib-submodule-update.sh          |  2 +-
 t/t0001-init.sh                    | 13 ++++--
 t/t1400-update-ref.sh              | 10 ++---
 t/t3200-branch.sh                  | 16 +++----
 t/t3201-branch-contains.sh         |  8 ++--
 t/t3203-branch-output.sh           |  4 +-
 t/t3205-branch-color.sh            |  8 ++--
 t/t5505-remote.sh                  | 30 ++++++-------
 t/t5510-fetch.sh                   |  8 ++--
 t/t5526-fetch-submodules.sh        | 70 +++++++++++++++---------------
 t/t5606-clone-options.sh           |  3 ++
 t/t5703-upload-pack-ref-in-want.sh |  6 +--
 t/t6200-fmt-merge-msg.sh           |  2 +-
 t/t6302-for-each-ref-filter.sh     | 24 +++++-----
 t/t9801-git-p4-branch.sh           | 12 ++---
 t/t9902-completion.sh              |  6 +--
 t/test-lib.sh                      |  7 +++
 19 files changed, 130 insertions(+), 108 deletions(-)

base-commit: 538228ed23a1d5e17e89bb17086d4dda51325bd8
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-758%2Fdscho%2Fprepare-for-main-branch-manual-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-758/dscho/prepare-for-main-branch-manual-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/758

Range-diff vs v1:

1: cf950c6f6a ! 1: bd2c72a348 fmt-merge-msg: also suppress "into main" by default
@@ Commit message
fmt-merge-msg: also suppress "into main" by default

In preparation for changing the default branch name to main, let's
- skip the suffix "into main" in merge commit messages.
+ skip the suffix "into main" in merge commit messages, the same way that
+ "into master" has been skipped by default.

  2:  5849eda331 =  2:  e819084eb3 t9801: use `--` in preparation for default branch rename
  3:  d9469202c2 =  3:  9c608c311e tests: start moving to a different default main branch name
  4:  baeb01f706 <  -:  ---------- t4013: prepare for the new default branch name "main"
  5:  7860d8d7df !  4:  9bd0a89a79 t6200: adjust suppression pattern to also match "main"
     @@ t/t6200-fmt-merge-msg.sh: test_expect_success 'merge.suppressDest configuration'
       	grep -e "Merge branch .side. into master$" actual &&
       
      -	git -c merge.suppressDest="ma??er" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
     -+	git -c merge.suppressDest="ma*" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
     ++	git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
       	head -n1 full.3 >actual &&
       	grep -e "Merge branch .side." actual &&
       	! grep -e " into master$" actual
  6:  0d2511d18f !  5:  b557ea5ac0 t5703: adjust a test case for the upcoming default branch name
     @@ t/t5703-upload-pack-ref-in-want.sh: test_expect_success 'server is initially beh
       	rm -rf local &&
       	cp -r "$LOCAL_PRISTINE" local &&
      -	echo "s/master/raster/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
     -+	echo "s/main/none/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
     ++	echo "s/main/rain/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
       	test_must_fail git -C local fetch 2>err &&
       
      -	test_i18ngrep "fatal: remote error: unknown ref refs/heads/raster" err
     -+	test_i18ngrep "fatal: remote error: unknown ref refs/heads/none" err
     ++	test_i18ngrep "fatal: remote error: unknown ref refs/heads/rain" err
       '
       
       # DO NOT add non-httpd-specific tests here, because the last part of this

7: e1740bb7d7 ! 6: 959a770c23 t3200: prepare for main being shorter than master
@@ Commit message

In the test case adjusted by this patch, we want to cut just after the longest shown ref name. Since main is shorter than master, we need
- to decrease the number of characters. Since main2 is shown, too, and
+ to decrease the number of characters. Since topic is shown, too, and
since that is only one character shorter than master, we decrement the
- length by one.
+ length by one instead of two.

  8:  1641d1950d =  7:  8db960009d t9902: prepare a test for the upcoming default branch name
  9:  5c29a89d88 =  8:  d15e39bb73 tests: prepare aligned mentions of the default branch name
 10:  66365bce55 =  9:  e542010fdd t1400: prepare for `main` being default branch name
Signature · 1 line
gitgitgadget
#25 lore raw

PATCH v2 1/9 fmt-merge-msg: also suppress "into main" by default

From: Johannes Schindelin <[email protected]>

In preparation for changing the default branch name to main, let's skip the suffix "into main" in merge commit messages, the same way that "into master" has been skipped by default.

---
 fmt-merge-msg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fmt-merge-msg.c +3 -1
index bd22e1ea88..9a664a4a58 100644
@@ -626,8 +626,10 @@ int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
 	void *current_branch_to_free;
 	struct merge_parents merge_parents;
 
-	if (!suppress_dest_pattern_seen)
+	if (!suppress_dest_pattern_seen) {
+		string_list_append(&suppress_dest_patterns, "main");
 		string_list_append(&suppress_dest_patterns, "master");
+	}
 
 	memset(&merge_parents, 0, sizeof(merge_parents));
 
Signature · 1 line
gitgitgadget
#26 lore raw

PATCH v2 2/9 t9801: use `--` in preparation for default branch rename

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

Seeing as we want to use main as the new default branch name used by git init, and that main is used as directory name in t9801, let's tighten the rev-list arguments to make it explicit when we are referring to a ref instead of a directory.

---
 t/t9801-git-p4-branch.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
t/t9801-git-p4-branch.sh +6 -6
index 67ff2711f5..a3abd778f9 100755
@@ -67,7 +67,7 @@ test_expect_success 'import main, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 4 wc
 	)
 '
@@ -78,7 +78,7 @@ test_expect_success 'import branch1, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -89,7 +89,7 @@ test_expect_success 'import branch2, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -100,7 +100,7 @@ test_expect_success 'import depot, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 8 wc
 	)
 '
@@ -114,7 +114,7 @@ test_expect_success 'import depot, branch detection' '
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
@@ -137,7 +137,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master >wc &&
+		git rev-list master -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
Signature · 1 line
gitgitgadget
#27 lore raw

PATCH v2 3/9 tests: start moving to a different default main branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

To allow for an incremental conversion to a new default main branch name, let's introduce GIT_TEST_DEFAULT_MAIN_BRANCH_NAME. This environment variable can be set at the top of each converted test script, overriding the default main branch name to use when initializing new repositories (or cloning empty repositories).

Note: the GIT_TEST_DEFAULT_MAIN_BRANCH_NAME is _not_ intended to be used manually; many tests require a specific main branch name and cannot simply work with another one. This GIT_TEST_* variable is meant purely for the transitional period while the entire test suite is converted to use main as the initial branch name by default.

We also introduce the PREPARE_FOR_MAIN_BRANCH prereq that determines whether the default main branch name is main, and adjust a couple of test functions to use it. This prereq will be used to temporarily disable a couple test cases to allow for adjusting the test script incrementally. Once an entire test is adjusted, we will adjust the test so that it is run with GIT_TEST_DEFAULT_MAIN_BRANCH_NAME=main.

---
 refs.c                    |  5 ++++-
 t/lib-submodule-update.sh |  2 +-
 t/t0001-init.sh           | 13 ++++++++++---
 t/t5606-clone-options.sh  |  3 +++
 t/test-lib.sh             |  7 +++++++
 5 files changed, 25 insertions(+), 5 deletions(-)
refs.c +4 -1
index fa01153151..392f0bbf68 100644
@@ -567,8 +567,11 @@ char *repo_default_branch_name(struct repository *r)
 	const char *config_key = "init.defaultbranch";
 	const char *config_display_key = "init.defaultBranch";
 	char *ret = NULL, *full_ref;
+	const char *env = getenv("GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME");
 
-	if (repo_config_get_string(r, config_key, &ret) < 0)
+	if (env && *env)
+		ret = xstrdup(env);
+	else if (repo_config_get_string(r, config_key, &ret) < 0)
 		die(_("could not retrieve `%s`"), config_display_key);
 
 	if (!ret)
t/lib-submodule-update.sh +1 -1
index 87a759149f..bd3fa3c6da 100644
@@ -144,7 +144,7 @@ create_lib_submodule_repo () {
 		git checkout -b valid_sub1 &&
 		git revert HEAD &&
 
-		git checkout master
+		git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}"
 	)
 }
 
t/t0001-init.sh +10 -3
index 2f7c3dcd0f..69a320489f 100755
@@ -553,14 +553,21 @@ test_expect_success '--initial-branch' '
 
 test_expect_success 'overridden default initial branch name (config)' '
 	test_config_global init.defaultBranch nmb &&
-	git init initial-branch-config &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git init initial-branch-config &&
 	git -C initial-branch-config symbolic-ref HEAD >actual &&
 	grep nmb actual
 '
 
+test_expect_success 'overridden default main branch name (env)' '
+	test_config_global init.defaultBranch nmb &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=env git init main-branch-env &&
+	git -C main-branch-env symbolic-ref HEAD >actual &&
+	grep env actual
+'
+
 test_expect_success 'invalid default branch name' '
-	test_config_global init.defaultBranch "with space" &&
-	test_must_fail git init initial-branch-invalid 2>err &&
+	test_must_fail env GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME="with space" \
+		git init initial-branch-invalid 2>err &&
 	test_i18ngrep "invalid branch name" err
 '
 
t/t5606-clone-options.sh +3 -0
index e69427f881..856eebf222 100755
@@ -37,6 +37,7 @@ test_expect_success 'redirected clone -v does show progress' '
 
 test_expect_success 'chooses correct default initial branch name' '
 	git init --bare empty &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
 	git -c init.defaultBranch=up clone empty whats-up &&
 	test refs/heads/up = $(git -C whats-up symbolic-ref HEAD) &&
 	test refs/heads/up = $(git -C whats-up config branch.up.merge)
@@ -51,9 +52,11 @@ test_expect_success 'guesses initial branch name correctly' '
 
 	git -c init.defaultBranch=none init --bare no-head &&
 	git -C initial-branch push ../no-head guess abc &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
 	git clone no-head is-it2 &&
 	test_must_fail git -C is-it2 symbolic-ref refs/remotes/origin/HEAD &&
 	git -C no-head update-ref --no-deref HEAD refs/heads/guess &&
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
 	git -c init.defaultBranch=guess clone no-head is-it3 &&
 	test refs/remotes/origin/guess = \
 		$(git -C is-it3 symbolic-ref refs/remotes/origin/HEAD)
t/test-lib.sh +7 -0
index ef31f40037..6b35070d22 100644
@@ -1702,3 +1702,10 @@ test_lazy_prereq SHA1 '
 test_lazy_prereq REBASE_P '
 	test -z "$GIT_TEST_SKIP_REBASE_P"
 '
+# Special-purpose prereq for transitioning to a new default branch name:
+# Some tests need more than just a mindless (case-preserving) s/master/main/g
+# replacement. The non-trivial adjustments are guarded behind this
+# prerequisite, acting kind of as a feature flag
+test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
+	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
+'
Signature · 1 line
gitgitgadget
#28 lore raw

PATCH v2 4/9 t6200: adjust suppression pattern to also match "main"

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

In preparation to running t6200 with the default branch name set to "main", let's adjust the only non-trivial aspect thereof. The rest will be done via a trivial sed invocation.

---
 t/t6200-fmt-merge-msg.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t6200-fmt-merge-msg.sh +1 -1
index 7d549748ef..f3e66eaf9b 100755
@@ -556,7 +556,7 @@ test_expect_success 'merge.suppressDest configuration' '
 	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 &&
+	git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
 	head -n1 full.3 >actual &&
 	grep -e "Merge branch .side." actual &&
 	! grep -e " into master$" actual
Signature · 1 line
gitgitgadget
#30 lore raw

PATCH v2 6/9 t3200: prepare for `main` being shorter than `master`

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

In the test case adjusted by this patch, we want to cut just after the longest shown ref name. Since main is shorter than master, we need to decrease the number of characters. Since topic is shown, too, and since that is only one character shorter than master, we decrement the length by one instead of two.

---
 t/t3200-branch.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
t/t3200-branch.sh +2 -2
index 6efe7a44bc..55b24b76ce 100755
@@ -375,9 +375,9 @@ test_expect_success 'git branch --column -v should fail' '
 	test_must_fail git branch --column -v
 '
 
-test_expect_success 'git branch -v with column.ui ignored' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
-	COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
+	COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
   a/b/c
Signature · 1 line
gitgitgadget
#31 lore raw

PATCH v2 7/9 t9902: prepare a test for the upcoming default branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

We need to adjust a test that uses a prefix of the default branch name, to accommodate for main being used soon.

---
 t/t9902-completion.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/t9902-completion.sh +3 -3
index 7b7bc6e4bd..0badcf829b 100755
@@ -1055,13 +1055,13 @@ test_expect_success 'teardown after filtering matching refs' '
 	git -C otherrepo branch -D matching/branch-in-other
 '
 
-test_expect_success '__git_refs - for-each-ref format specifiers in prefix' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH '__git_refs - for-each-ref format specifiers in prefix' '
 	cat >expected <<-EOF &&
 	evil-%%-%42-%(refname)..master
 	EOF
 	(
-		cur="evil-%%-%42-%(refname)..mas" &&
-		__git_refs "" "" "evil-%%-%42-%(refname).." mas >"$actual"
+		cur="evil-%%-%42-%(refname)..mai" &&
+		__git_refs "" "" "evil-%%-%42-%(refname).." mai >"$actual"
 	) &&
 	test_cmp expected "$actual"
 '
Signature · 1 line
gitgitgadget
#29 lore raw

PATCH v2 5/9 t5703: adjust a test case for the upcoming default branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

We want to rename the default branch name used by git init in the near future, using main as the new name.

In preparation for that, we adjust a test case that wants to rename the default branch to a different name that however has the same length. We use none as that name because it matches the length of main.

As this test case cannot possibly pass until the default branch name is _actually_ changed, we temporarily guard it behind a special-purpose prereq, until the test suite is fully converted to use that new default branch name.

---
 t/t5703-upload-pack-ref-in-want.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/t5703-upload-pack-ref-in-want.sh +3 -3
index d9ecf0f4a9..b46940b725 100755
@@ -383,14 +383,14 @@ test_expect_success 'server is initially behind - ref in want' '
 	test_cmp expected actual
 '
 
-test_expect_success 'server loses a ref - ref in want' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	echo "s/master/raster/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
+	echo "s/main/rain/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
 	test_must_fail git -C local fetch 2>err &&
 
-	test_i18ngrep "fatal: remote error: unknown ref refs/heads/raster" err
+	test_i18ngrep "fatal: remote error: unknown ref refs/heads/rain" err
 '
 
 # DO NOT add non-httpd-specific tests here, because the last part of this
Signature · 1 line
gitgitgadget
#32 lore raw

PATCH v2 8/9 tests: prepare aligned mentions of the default branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

In some tests, the default branch name is part of aligned output. As we want to change the default branch name to main, which is two characters shorter than the old default branch name, we will have to adjust those tests.

Since we use the original default branch name until the entire test suite has been adjusted accordingly, the touched test cases need to be guarded by a prereq (that is so far disabled so that they are skipped for now).

The test cases that depend on those test cases that are newly guarded by that prereq naturally have to be guarded, too.

---
 t/t3200-branch.sh              | 12 +++---
 t/t3201-branch-contains.sh     |  8 ++--
 t/t3203-branch-output.sh       |  4 +-
 t/t3205-branch-color.sh        |  8 ++--
 t/t5505-remote.sh              | 30 +++++++--------
 t/t5510-fetch.sh               |  8 ++--
 t/t5526-fetch-submodules.sh    | 70 +++++++++++++++++-----------------
 t/t6302-for-each-ref-filter.sh | 24 ++++++------
 8 files changed, 82 insertions(+), 82 deletions(-)
t/t3200-branch.sh +6 -6
index 55b24b76ce..a0b832d59e 100755
@@ -321,11 +321,11 @@ test_expect_success 'git branch --list -v with --abbrev' '
 
 '
 
-test_expect_success 'git branch --column' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expect <<\EOF &&
-  a/b/c    bam      foo      l      * master   n        o/p      r
-  abc      bar      j/k      m/m      mb       o/o      q        topic
+  a/b/c   bam     foo     l     * main    n       o/p     r
+  abc     bar     j/k     m/m     mb      o/o     q       topic
 EOF
 	test_cmp expect actual
 '
@@ -358,15 +358,15 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success 'git branch with column.*' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
 	git config column.ui column &&
 	git config column.branch "dense" &&
 	COLUMNS=80 git branch >actual &&
 	git config --unset column.branch &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
-  a/b/c   bam   foo   l   * master   n     o/p   r
-  abc     bar   j/k   m/m   mb       o/o   q     topic
+  a/b/c   bam   foo   l   * main   n     o/p   r
+  abc     bar   j/k   m/m   mb     o/o   q     topic
 EOF
 	test_cmp expect actual
 '
t/t3201-branch-contains.sh +4 -4
index efea5c4971..3733cd0091 100755
@@ -242,7 +242,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # Here "topic" tracks "master" with one extra commit, and "zzz" points to the
 # same tip as master The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
-test_expect_success 'branch --merged with --verbose' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
 	git branch --track topic master &&
 	git branch zzz topic &&
 	git checkout topic &&
@@ -256,9 +256,9 @@ test_expect_success 'branch --merged with --verbose' '
 	test_cmp expect actual &&
 	git branch --verbose --merged topic >actual &&
 	cat >expect <<-EOF &&
-	  master $(git rev-parse --short master) second on master
-	* topic  $(git rev-parse --short topic ) [ahead 1] foo
-	  zzz    $(git rev-parse --short zzz   ) second on master
+	  main  $(git rev-parse --short main) second on main
+	* topic $(git rev-parse --short topic ) [ahead 1] foo
+	  zzz   $(git rev-parse --short zzz   ) second on main
 	EOF
 	test_i18ncmp expect actual
 '
t/t3203-branch-output.sh +2 -2
index 71818b90f0..d65586541d 100755
@@ -329,7 +329,7 @@ test_expect_success '--color overrides auto-color' '
 	test_cmp expect.color actual
 '
 
-test_expect_success 'verbose output lists worktree path' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
 	one=$(git rev-parse --short HEAD) &&
 	two=$(git rev-parse --short master) &&
 	cat >expect <<-EOF &&
@@ -337,7 +337,7 @@ test_expect_success 'verbose output lists worktree path' '
 	  ambiguous                    $one one
 	  branch-one                   $two two
 	+ branch-two                   $one ($(pwd)/worktree_dir) one
-	  master                       $two two
+	  main                         $two two
 	  ref-to-branch                $two two
 	  ref-to-remote                $two two
 	EOF
t/t3205-branch-color.sh +4 -4
index 4f1e16bb44..289625c464 100755
@@ -28,12 +28,12 @@ test_expect_success 'regular output shows colors' '
 	test_cmp expect actual
 '
 
-test_expect_success 'verbose output shows colors' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
 	oid=$(git rev-parse --short HEAD) &&
 	cat >expect <<-EOF &&
-	* <CYAN>master               <RESET> $oid foo
-	  <BLUE>other                <RESET> $oid foo
-	  <YELLOW>remotes/origin/master<RESET> $oid foo
+	* <CYAN>main               <RESET> $oid foo
+	  <BLUE>other              <RESET> $oid foo
+	  <YELLOW>remotes/origin/main<RESET> $oid foo
 	EOF
 	git branch --color -v -a >actual.raw &&
 	test_decode_color <actual.raw >actual &&
t/t5505-remote.sh +15 -15
index 8d62edd98b..de0e3df14a 100755
@@ -200,28 +200,28 @@ cat >test/expect <<EOF
   Push  URL: $(pwd)/one
   HEAD branch: master
   Remote branches:
-    master new (next fetch will store in remotes/origin)
-    side   tracked
+    main new (next fetch will store in remotes/origin)
+    side tracked
   Local branches configured for 'git pull':
-    ahead    merges with remote master
-    master   merges with remote master
+    ahead    merges with remote main
+    main     merges with remote main
     octopus  merges with remote topic-a
                 and with remote topic-b
                 and with remote topic-c
     rebase  rebases onto remote master
   Local refs configured for 'git push':
-    master pushes to master   (local out of date)
-    master pushes to upstream (create)
+    main pushes to main     (local out of date)
+    main pushes to upstream (create)
 * remote two
   Fetch URL: ../two
   Push  URL: ../three
   HEAD branch: master
   Local refs configured for 'git push':
-    ahead  forces to master  (fast-forwardable)
-    master pushes to another (up to date)
+    ahead forces to main    (fast-forwardable)
+    main  pushes to another (up to date)
 EOF
 
-test_expect_success 'show' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
 	(
 		cd test &&
 		git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
@@ -264,15 +264,15 @@ cat >test/expect <<EOF
     master
     side
   Local branches configured for 'git pull':
-    ahead  merges with remote master
-    master merges with remote master
+    ahead merges with remote main
+    main  merges with remote main
   Local refs configured for 'git push' (status not queried):
     (matching)           pushes to (matching)
-    refs/heads/master    pushes to refs/heads/upstream
+    refs/heads/main      pushes to refs/heads/upstream
     refs/tags/lastbackup forces to refs/tags/lastbackup
 EOF
 
-test_expect_success 'show -n' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
 	mv one one.unreachable &&
 	(
 		cd test &&
@@ -315,7 +315,7 @@ test_expect_success 'set-head --auto' '
 	)
 '
 
-test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
 	(
 		cd test &&
 		git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1335,7 +1335,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 	)
 '
 
-test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
 	(
 		cd two &&
 		git tag -a -m "Some tag" my-tag master &&
t/t5510-fetch.sh +4 -4
index dbc724e4c0..5d673358f9 100755
@@ -942,7 +942,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
 	)
 '
 
-test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
 	git clone . full-output &&
 	test_commit looooooooooooong-tag &&
 	(
@@ -951,13 +951,13 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
 		grep -e "->" actual | cut -c 22- >../actual
 	) &&
 	cat >expect <<-\EOF &&
-	master               -> origin/master
+	main                 -> origin/main
 	looooooooooooong-tag -> looooooooooooong-tag
 	EOF
 	test_cmp expect actual
 '
 
-test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
 	git clone . compact &&
 	test_commit extraaa &&
 	(
@@ -966,7 +966,7 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
 		grep -e "->" actual | cut -c 22- >../actual
 	) &&
 	cat >expect <<-\EOF &&
-	master     -> origin/*
+	main       -> origin/*
 	extraaa    -> *
 	EOF
 	test_cmp expect actual
t/t5526-fetch-submodules.sh +35 -35

279 lines not on this page · raw message

t/t6302-for-each-ref-filter.sh +12 -12
index 781e470aea..0a21669f56 100755
@@ -113,9 +113,9 @@ test_expect_success '%(color) must fail' '
 	test_must_fail git for-each-ref --format="%(color)%(refname)"
 '
 
-test_expect_success 'left alignment is default' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
 	cat >expect <<-\EOF &&
-	refname is refs/heads/master  |refs/heads/master
+	refname is refs/heads/main    |refs/heads/main
 	refname is refs/heads/side    |refs/heads/side
 	refname is refs/odd/spot      |refs/odd/spot
 	refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -131,9 +131,9 @@ test_expect_success 'left alignment is default' '
 	test_cmp expect actual
 '
 
-test_expect_success 'middle alignment' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
 	cat >expect <<-\EOF &&
-	| refname is refs/heads/master |refs/heads/master
+	|  refname is refs/heads/main  |refs/heads/main
 	|  refname is refs/heads/side  |refs/heads/side
 	|   refname is refs/odd/spot   |refs/odd/spot
 	|refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -149,9 +149,9 @@ test_expect_success 'middle alignment' '
 	test_cmp expect actual
 '
 
-test_expect_success 'right alignment' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' '
 	cat >expect <<-\EOF &&
-	|  refname is refs/heads/master|refs/heads/master
+	|    refname is refs/heads/main|refs/heads/main
 	|    refname is refs/heads/side|refs/heads/side
 	|      refname is refs/odd/spot|refs/odd/spot
 	|refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -168,7 +168,7 @@ test_expect_success 'right alignment' '
 '
 
 cat >expect <<-\EOF
-|       refname is refs/heads/master       |refs/heads/master
+|        refname is refs/heads/main        |refs/heads/main
 |        refname is refs/heads/side        |refs/heads/side
 |         refname is refs/odd/spot         |refs/odd/spot
 |    refname is refs/tags/annotated-tag    |refs/tags/annotated-tag
@@ -184,7 +184,7 @@ EOF
 test_align_permutations() {
 	while read -r option
 	do
-		test_expect_success "align:$option" '
+		test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" '
 			git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual &&
 			test_cmp expect actual
 		'
@@ -213,9 +213,9 @@ EOF
 
 # Individual atoms inside %(align:...) and %(end) must not be quoted.
 
-test_expect_success 'alignment with format quote' "
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
 	cat >expect <<-\EOF &&
-	|'      '\''master| A U Thor'\''      '|
+	|'       '\''main| A U Thor'\''       '|
 	|'       '\''side| A U Thor'\''       '|
 	|'     '\''odd/spot| A U Thor'\''     '|
 	|'      '\''annotated-tag| '\''       '|
@@ -231,9 +231,9 @@ test_expect_success 'alignment with format quote' "
 	test_cmp expect actual
 "
 
-test_expect_success 'nested alignment with quote formatting' "
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' "
 	cat >expect <<-\EOF &&
-	|'         master               '|
+	|'           main               '|
 	|'           side               '|
 	|'       odd/spot               '|
 	|'  annotated-tag               '|
Signature · 1 line
gitgitgadget
#33 lore raw

PATCH v2 9/9 t1400: prepare for `main` being default branch name

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

In addition to the trivial search-and-replace, there are three non-trivial adjustments necessary.

Mark the respective test cases with the transitional prereq and make those non-trivial adjustments early, to make this change easier to review.

---
 t/t1400-update-ref.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
t/t1400-update-ref.sh +5 -5
index 770e7be363..4c01e08551 100755
@@ -585,10 +585,10 @@ test_expect_success 'stdin fails on unbalanced quotes' '
 	grep "fatal: badly quoted argument: \\\"master" err
 '
 
-test_expect_success 'stdin fails on invalid escape' '
-	echo "create $a \"ma\zter\"" >stdin &&
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
+	echo "create $a \"ma\zn\"" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	grep "fatal: badly quoted argument: \\\"ma\\\\zter\\\"" err
+	grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
 '
 
 test_expect_success 'stdin fails on junk after quoted argument' '
@@ -704,9 +704,9 @@ test_expect_success 'stdin succeeds with quoted argument' '
 	test_cmp expect actual
 '
 
-test_expect_success 'stdin succeeds with escaped character' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
 	git update-ref -d $a &&
-	echo "create $a \"ma\\163ter\"" >stdin &&
+	echo "create $a \"ma\\151n\"" >stdin &&
 	git update-ref --stdin <stdin &&
 	git rev-parse $m >expect &&
 	git rev-parse $a >actual &&
Signature · 1 line
gitgitgadget
#34 lore raw
In reply to Johannes Schindelin via GitGitGadget

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 13 lines · writes:

Changes since v1:

* The t4013 patch was moved out of this patch series, to be re-submitted at a later date, to avoid clashing with other patches in seen.
* The commit message of 'fmt-merge-msg: also suppress "into main" by default' was adjusted to mention that we do the same for main as we do for master.
* The t5703 patch now uses rain instead of none, to be closer to the default branch name.
* The glob in t6200 was tightened to avoid matching maint.
* The commit message of 't3200: prepare for main being shorter than master' stopped talking about main2 (which itself was a left-over from a previous iteration of a previous patch series).

All looked sensible. Thanks; will replace and hopefully we can move these to 'next' once we rebuild it on 2.29.