git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Inclusive naming, part II
@ 2020-09-16 18:10 Johannes Schindelin via GitGitGadget
  2020-09-16 18:10 ` [PATCH 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
                   ` (5 more replies)
  0 siblings, 6 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-16 18:10 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

This patch series represents the logical next step on the journey begun with
introducing init.defaultBranch: in these patches, we avoid a couple
unnecessary mentions of the branch name "master".

This patch series does not try to change the default branch name, although I
have that patch series ready to go. You can see the overall idea here: 
https://github.com/gitgitgadget/git/pull/655. Concretely, I plan on
submitting three more patch series after this one:

 1. a relatively small patch series to avoid using the branch name main in
    the test suite. This is necessary because my plan is to change the
    default branch name to that name, therefore it cannot be used as the
    name of a topic branch any longer.
 2. a relatively large patch series (currently consisting of 18 patches) to
    change the default branch name to main. Most of the patches provide
    non-trivial (read: non-scriptable) adjustments to the test suite in an
    incremental fashion, with a big patch toward the end that reflects a
    fully-automated search-and-replace of all the trivial cases.
 3. a very small patch series with fall-out patches that are not necessary
    to pass the test suite, but are still required to complete the rename
    (adjusted code comment, file rename).

(Note: I am still debating whether I should move one or two patches from the
second to the third patch series)

Johannes Schindelin (5):
  fast-export: avoid using unnecessary language in a code comment
  t/test-terminal: avoid non-inclusive language
  t3200: avoid variations of the `master` branch name
  tests: avoid variations of the `master` branch name
  t9902: avoid using the branch name `master`

 builtin/fast-export.c        |  2 +-
 t/t3200-branch.sh            | 34 ++++++++++++++---------------
 t/t3427-rebase-subtree.sh    | 42 ++++++++++++++++++------------------
 t/t4150-am.sh                |  8 +++----
 t/t5515-fetch-merge-logic.sh |  6 +++---
 t/t5523-push-upstream.sh     | 20 ++++++++---------
 t/t6018-rev-list-glob.sh     |  6 +++---
 t/t6040-tracking-info.sh     | 20 ++++++++---------
 t/t6409-merge-subtree.sh     | 14 ++++++------
 t/t9902-completion.sh        | 10 ++++-----
 t/test-terminal.perl         | 32 +++++++++++++--------------
 11 files changed, 97 insertions(+), 97 deletions(-)


base-commit: 54e85e7af1ac9e9a92888060d6811ae767fea1bc
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-734%2Fdscho%2Favoid-unnecessary-branch-name-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-734/dscho/avoid-unnecessary-branch-name-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/734
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 1/5] fast-export: avoid using unnecessary language in a code comment
  2020-09-16 18:10 [PATCH 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
@ 2020-09-16 18:10 ` Johannes Schindelin via GitGitGadget
  2020-09-16 21:05   ` Junio C Hamano
  2020-09-16 18:10 ` [PATCH 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-16 18:10 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In an ongoing effort to avoid non-inclusive language, let's avoid using
the branch name "master" in a code comment.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 builtin/fast-export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 1b8fca3ee0..5527135ba8 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -1026,7 +1026,7 @@ static void handle_tags_and_duplicates(struct string_list *extras)
 				/*
 				 * Getting here means we have a commit which
 				 * was excluded by a negative refspec (e.g.
-				 * fast-export ^master master).  If we are
+				 * fast-export ^HEAD HEAD).  If we are
 				 * referencing excluded commits, set the ref
 				 * to the exact commit.  Otherwise, the user
 				 * wants the branch exported but every commit
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 2/5] t/test-terminal: avoid non-inclusive language
  2020-09-16 18:10 [PATCH 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
  2020-09-16 18:10 ` [PATCH 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
@ 2020-09-16 18:10 ` Johannes Schindelin via GitGitGadget
  2020-09-16 21:05   ` Junio C Hamano
  2020-09-16 18:10 ` [PATCH 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-16 18:10 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In the ongoing effort to make the Git project a more inclusive place,
let's try to avoid names like "master" where possible.

In this instance, the use of the term `slave` is unfortunately enshrined
in IO::Pty's API. We simply cannot avoid using that word here. But at
least we can get rid of the usage of the word `master` and hope that
IO::Pty will be eventually adjusted, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/test-terminal.perl | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/t/test-terminal.perl b/t/test-terminal.perl
index 46bf618479..680caf48dd 100755
--- a/t/test-terminal.perl
+++ b/t/test-terminal.perl
@@ -81,24 +81,24 @@ sub copy_stdio {
 	die "usage: test-terminal program args";
 }
 $ENV{TERM} = 'vt100';
-my $master_in = new IO::Pty;
-my $master_out = new IO::Pty;
-my $master_err = new IO::Pty;
-$master_in->set_raw();
-$master_out->set_raw();
-$master_err->set_raw();
-$master_in->slave->set_raw();
-$master_out->slave->set_raw();
-$master_err->slave->set_raw();
-my $pid = start_child(\@ARGV, $master_in->slave, $master_out->slave, $master_err->slave);
-close $master_in->slave;
-close $master_out->slave;
-close $master_err->slave;
-my $in_pid = copy_stdin($master_in);
-copy_stdio($master_out, $master_err);
+my $primary_in = new IO::Pty;
+my $primary_out = new IO::Pty;
+my $primary_err = new IO::Pty;
+$primary_in->set_raw();
+$primary_out->set_raw();
+$primary_err->set_raw();
+$primary_in->slave->set_raw();
+$primary_out->slave->set_raw();
+$primary_err->slave->set_raw();
+my $pid = start_child(\@ARGV, $primary_in->slave, $primary_out->slave, $primary_err->slave);
+close $primary_in->slave;
+close $primary_out->slave;
+close $primary_err->slave;
+my $in_pid = copy_stdin($primary_in);
+copy_stdio($primary_out, $primary_err);
 my $ret = finish_child($pid);
 # If the child process terminates before our copy_stdin() process is able to
-# write all of its data to $master_in, the copy_stdin() process could stall.
+# write all of its data to $primary_in, the copy_stdin() process could stall.
 # Send SIGTERM to it to ensure it terminates.
 kill 'TERM', $in_pid;
 finish_child($in_pid);
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 3/5] t3200: avoid variations of the `master` branch name
  2020-09-16 18:10 [PATCH 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
  2020-09-16 18:10 ` [PATCH 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
  2020-09-16 18:10 ` [PATCH 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
@ 2020-09-16 18:10 ` Johannes Schindelin via GitGitGadget
  2020-09-16 21:11   ` Jeff King
  2020-09-16 18:10 ` [PATCH 4/5] tests: " Johannes Schindelin via GitGitGadget
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-16 18:10 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

To avoid branch names with a loaded history, we already started to avoid
using the name "master" in a couple instances.

The `t3200-branch.sh` script uses variations of this name for branches
other than the default one. So let's change those names, as
"lowest-hanging fruits" in the effort to use more inclusive naming
throughout Git's source code.

In this particular instance, this requires a couple of non-trivial
adjustments, as the aligned output depends on the maximum length of the
displayed branches (which we now changed), and also on the alphabetical
order (which we now changed, too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3200-branch.sh | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 4c0734157b..c1b881c0b8 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -234,10 +234,10 @@ test_expect_success 'git branch -M master master should work when master is chec
 	git branch -M master master
 '
 
-test_expect_success 'git branch -M master2 master2 should work when master is checked out' '
+test_expect_success 'git branch -M main2 main2 should work when master is checked out' '
 	git checkout master &&
-	git branch master2 &&
-	git branch -M master2 master2
+	git branch main2 &&
+	git branch -M main2 main2
 '
 
 test_expect_success 'git branch -v -d t should work' '
@@ -324,8 +324,8 @@ test_expect_success 'git branch --list -v with --abbrev' '
 test_expect_success 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expect <<\EOF &&
-  a/b/c     bam       foo       l       * master    mb        o/o       q
-  abc       bar       j/k       m/m       master2   n         o/p       r
+  a/b/c    bam      foo      l        main2    mb       o/o      q
+  abc      bar      j/k      m/m    * master   n        o/p      r
 EOF
 	test_cmp expect actual
 '
@@ -345,8 +345,8 @@ test_expect_success 'git branch --column with an extremely long branch name' '
   j/k
   l
   m/m
+  main2
 * master
-  master2
   mb
   n
   o/o
@@ -365,8 +365,8 @@ test_expect_success 'git branch with column.*' '
 	git config --unset column.branch &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
-  a/b/c   bam   foo   l   * master    mb   o/o   q
-  abc     bar   j/k   m/m   master2   n    o/p   r
+  a/b/c   bam   foo   l     main2    mb   o/o   q
+  abc     bar   j/k   m/m * master   n    o/p   r
 EOF
 	test_cmp expect actual
 '
@@ -377,7 +377,7 @@ test_expect_success 'git branch --column -v should fail' '
 
 test_expect_success 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
-	COLUMNS=80 git branch -v | cut -c -10 | sed "s/ *$//" >actual &&
+	COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
   a/b/c
@@ -388,8 +388,8 @@ test_expect_success 'git branch -v with column.ui ignored' '
   j/k
   l
   m/m
+  main2
 * master
-  master2
   mb
   n
   o/o
@@ -597,10 +597,10 @@ test_expect_success 'git branch -C master master should work when master is chec
 	git branch -C master master
 '
 
-test_expect_success 'git branch -C master5 master5 should work when master is checked out' '
+test_expect_success 'git branch -C main5 main5 should work when master is checked out' '
 	git checkout master &&
-	git branch master5 &&
-	git branch -C master5 master5
+	git branch main5 &&
+	git branch -C main5 main5
 '
 
 test_expect_success 'git branch -C ab cd should overwrite existing config for cd' '
@@ -711,11 +711,11 @@ test_expect_success 'deleting a self-referential symref' '
 '
 
 test_expect_success 'renaming a symref is not allowed' '
-	git symbolic-ref refs/heads/master2 refs/heads/master &&
-	test_must_fail git branch -m master2 master3 &&
-	git symbolic-ref refs/heads/master2 &&
+	git symbolic-ref refs/heads/main2 refs/heads/master &&
+	test_must_fail git branch -m main2 main3 &&
+	git symbolic-ref refs/heads/main2 &&
 	test_path_is_file .git/refs/heads/master &&
-	test_path_is_missing .git/refs/heads/master3
+	test_path_is_missing .git/refs/heads/main3
 '
 
 test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 4/5] tests: avoid variations of the `master` branch name
  2020-09-16 18:10 [PATCH 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
                   ` (2 preceding siblings ...)
  2020-09-16 18:10 ` [PATCH 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
@ 2020-09-16 18:10 ` Johannes Schindelin via GitGitGadget
  2020-09-16 18:10 ` [PATCH 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
  5 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-16 18:10 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

The term `master` has a loaded history that serves as a constant
reminder of racial injustice. The Git project has no desire to
perpetuate this and already started avoiding it.

The test suite uses variations of this name for branches other than the
default one. Apart from t3200, where we just addressed this in the
previous commit, those instances can be renamed in an automated manner
because they do not require any changes outside of the test script, so
let's do that.

Seeing as `main` seems to be materializing as the favorite default
branch name of many Open Source projects, we use that name in our
replacements, too.

This trick was performed by this (GNU) sed invocation:

	$ sed -i 's/master\([a-z0-9]\)/main\1/g' t/t*.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3427-rebase-subtree.sh    | 42 ++++++++++++++++++------------------
 t/t4150-am.sh                |  8 +++----
 t/t5515-fetch-merge-logic.sh |  6 +++---
 t/t5523-push-upstream.sh     | 20 ++++++++---------
 t/t6018-rev-list-glob.sh     |  6 +++---
 t/t6040-tracking-info.sh     | 20 ++++++++---------
 t/t6409-merge-subtree.sh     | 14 ++++++------
 7 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 79e43a370b..ba27e9d603 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -15,12 +15,12 @@ commit_message() {
 # this test script tries to document them.  First, the following commit history
 # is generated (the onelines are shown, time flows from left to right):
 #
-# master1 - master2 - master3
+# main1 - main2 - main3
 #                             \
-# README ---------------------- Add subproject master - master4 - files_subtree/master5
+# README ---------------------- Add subproject master - main4 - files_subtree/main5
 #
 # Where the merge moves the files master[123].t into the subdirectory
-# files_subtree/ and master4 as well as files_subtree/master5 add files to that
+# files_subtree/ and main4 as well as files_subtree/main5 add files to that
 # directory directly.
 #
 # Then, in subsequent test cases, `git filter-branch` is used to distill just
@@ -28,11 +28,11 @@ commit_message() {
 # an empty commit is added on top. The pre-rebase commit history looks like
 # this:
 #
-# Add subproject master - master4 - files_subtree/master5 - Empty commit
+# Add subproject master - main4 - files_subtree/main5 - Empty commit
 #
-# where the root commit adds three files: master1.t, master2.t and master3.t.
+# where the root commit adds three files: main1.t, main2.t and main3.t.
 #
-# This commit history is then rebased onto `master3` with the
+# This commit history is then rebased onto `main3` with the
 # `-Xsubtree=files_subtree` option in three different ways:
 #
 # 1. using `--preserve-merges`
@@ -43,9 +43,9 @@ test_expect_success 'setup' '
 	test_commit README &&
 
 	git init files &&
-	test_commit -C files master1 &&
-	test_commit -C files master2 &&
-	test_commit -C files master3 &&
+	test_commit -C files main1 &&
+	test_commit -C files main2 &&
+	test_commit -C files main3 &&
 
 	: perform subtree merge into files_subtree/ &&
 	git fetch files refs/heads/master:refs/heads/files-master &&
@@ -55,8 +55,8 @@ test_expect_success 'setup' '
 	git commit -m "Add subproject master" &&
 
 	: add two extra commits to rebase &&
-	test_commit -C files_subtree master4 &&
-	test_commit files_subtree/master5 &&
+	test_commit -C files_subtree main4 &&
+	test_commit files_subtree/main5 &&
 
 	git checkout -b to-rebase &&
 	git fast-export --no-data HEAD -- files_subtree/ |
@@ -66,22 +66,22 @@ test_expect_success 'setup' '
 	git commit -m "Empty commit" --allow-empty
 '
 
-# FAILURE: Does not preserve master4.
+# FAILURE: Does not preserve main4.
 test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-preserve-merges to-rebase &&
 	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
-	verbose test "$(commit_message HEAD~)" = "master4" &&
-	verbose test "$(commit_message HEAD)" = "files_subtree/master5"
+	verbose test "$(commit_message HEAD~)" = "main4" &&
+	verbose test "$(commit_message HEAD)" = "files_subtree/main5"
 '
 
-# FAILURE: Does not preserve master4.
+# FAILURE: Does not preserve main4.
 test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-keep-empty to-rebase &&
 	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "main4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
@@ -91,8 +91,8 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-master master &&
 	: first pick results in no changes &&
 	git rebase --skip &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "main4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
@@ -102,8 +102,8 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit'
 	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-master --root &&
 	: first pick results in no changes &&
 	git rebase --skip &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "main4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 1da8ab120b..3d8dc7eb12 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -465,7 +465,7 @@ test_expect_success 'am changes committer and keeps author' '
 test_expect_success 'am --signoff adds Signed-off-by: line' '
 	rm -fr .git/rebase-apply &&
 	git reset --hard &&
-	git checkout -b master2 first &&
+	git checkout -b main2 first &&
 	git am --signoff <patch2 &&
 	{
 		printf "third\n\nSigned-off-by: %s <%s>\n\n" \
@@ -479,7 +479,7 @@ test_expect_success 'am --signoff adds Signed-off-by: line' '
 '
 
 test_expect_success 'am stays in branch' '
-	echo refs/heads/master2 >expected &&
+	echo refs/heads/main2 >expected &&
 	git symbolic-ref HEAD >actual &&
 	test_cmp expected actual
 '
@@ -540,7 +540,7 @@ test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '
 	git reset --hard HEAD^ &&
 	git am <patch4 &&
 	git rev-parse HEAD >expected &&
-	git rev-parse master2 >actual &&
+	git rev-parse main2 >actual &&
 	test_cmp expected actual
 '
 
@@ -567,7 +567,7 @@ test_expect_success 'am --keep-non-patch really keeps the non-patch part' '
 test_expect_success 'setup am -3' '
 	rm -fr .git/rebase-apply &&
 	git reset --hard &&
-	git checkout -b base3way master2 &&
+	git checkout -b base3way main2 &&
 	sed -n -e "3,\$p" msg >file &&
 	head -n 9 msg >>file &&
 	git add file &&
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 9d6a46ff56..b1c18cc993 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -15,7 +15,7 @@ export GIT_TEST_PROTOCOL_VERSION
 
 build_script () {
 	script="$1" &&
-	for i in one three_file master master2 one_tree three two two2 three2
+	for i in one three_file master main2 one_tree three two two2 three2
 	do
 		echo "s/$(test_oid --hash=sha1 "$i")/$(test_oid "$i")/g" >>"$script"
 	done
@@ -52,8 +52,8 @@ test_expect_success setup '
 	two sha1:525b7fb068d59950d185a8779dc957c77eed73ba
 	two sha256:3b21de3440cd38c2a9e9b464adb923f7054949ed4c918e1a0ac4c95cd52774db
 
-	master2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
-	master2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
+	main2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
+	main2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
 
 	two2 sha1:6134ee8f857693b96ff1cc98d3e2fd62b199e5a8
 	two2 sha256:87a2d3ee29c83a3dc7afd41c0606b11f67603120b910a7be7840accdc18344d4
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index c0df81a014..6b5f2e373d 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -41,20 +41,20 @@ test_expect_success 'push -u --dry-run master:otherX' '
 	check_config master upstream refs/heads/other
 '
 
-test_expect_success 'push -u master2:master2' '
-	git branch master2 &&
-	git push -u upstream master2:master2 &&
-	check_config master2 upstream refs/heads/master2
+test_expect_success 'push -u main2:main2' '
+	git branch main2 &&
+	git push -u upstream main2:main2 &&
+	check_config main2 upstream refs/heads/main2
 '
 
-test_expect_success 'push -u master2:other2' '
-	git push -u upstream master2:other2 &&
-	check_config master2 upstream refs/heads/other2
+test_expect_success 'push -u main2:other2' '
+	git push -u upstream main2:other2 &&
+	check_config main2 upstream refs/heads/other2
 '
 
-test_expect_success 'push -u :master2' '
-	git push -u upstream :master2 &&
-	check_config master2 upstream refs/heads/other2
+test_expect_success 'push -u :main2' '
+	git push -u upstream :main2 &&
+	check_config main2 upstream refs/heads/other2
 '
 
 test_expect_success 'push -u --all' '
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index b31ff7eeec..5df38a39e5 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -32,11 +32,11 @@ test_expect_success 'setup' '
 	git checkout -b someref master &&
 	commit some &&
 	git checkout master &&
-	commit master2 &&
+	commit main2 &&
 	git tag foo/bar master &&
-	commit master3 &&
+	commit main3 &&
 	git update-ref refs/remotes/foo/baz master &&
-	commit master4 &&
+	commit main4 &&
 	git update-ref refs/remotes/upstream/one subspace/one &&
 	git update-ref refs/remotes/upstream/two subspace/two &&
 	git update-ref refs/remotes/upstream/x subspace-x &&
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index ad1922b999..946d05c879 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -264,25 +264,25 @@ test_expect_success 'fail to track annotated tags' '
 test_expect_success '--set-upstream-to does not change branch' '
 	git branch from-master master &&
 	git branch --set-upstream-to master from-master &&
-	git branch from-master2 master &&
-	test_must_fail git config branch.from-master2.merge > actual &&
-	git rev-list from-master2 &&
-	git update-ref refs/heads/from-master2 from-master2^ &&
-	git rev-parse from-master2 >expect2 &&
-	git branch --set-upstream-to master from-master2 &&
+	git branch from-main2 master &&
+	test_must_fail git config branch.from-main2.merge > actual &&
+	git rev-list from-main2 &&
+	git update-ref refs/heads/from-main2 from-main2^ &&
+	git rev-parse from-main2 >expect2 &&
+	git branch --set-upstream-to master from-main2 &&
 	git config branch.from-master.merge > actual &&
-	git rev-parse from-master2 >actual2 &&
+	git rev-parse from-main2 >actual2 &&
 	grep -q "^refs/heads/master$" actual &&
 	cmp expect2 actual2
 '
 
 test_expect_success '--set-upstream-to @{-1}' '
 	git checkout follower &&
-	git checkout from-master2 &&
-	git config branch.from-master2.merge > expect2 &&
+	git checkout from-main2 &&
+	git config branch.from-main2.merge > expect2 &&
 	git branch --set-upstream-to @{-1} from-master &&
 	git config branch.from-master.merge > actual &&
-	git config branch.from-master2.merge > actual2 &&
+	git config branch.from-main2.merge > actual2 &&
 	git branch --set-upstream-to follower from-master &&
 	git config branch.from-master.merge > expect &&
 	test_cmp expect2 actual2 &&
diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh
index 793f0c8bf3..8189c7879e 100755
--- a/t/t6409-merge-subtree.sh
+++ b/t/t6409-merge-subtree.sh
@@ -94,10 +94,10 @@ test_expect_success 'merge update' '
 	echo git-gui2 > git-gui.sh &&
 	o3=$(git hash-object git-gui.sh) &&
 	git add git-gui.sh &&
-	git checkout -b master2 &&
+	git checkout -b main2 &&
 	git commit -m "update git-gui" &&
 	cd ../git &&
-	git pull -s subtree gui master2 &&
+	git pull -s subtree gui main2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o3 0	git-gui/git-gui.sh" &&
@@ -109,7 +109,7 @@ test_expect_success 'merge update' '
 test_expect_success 'initial ambiguous subtree' '
 	cd ../git &&
 	git reset --hard master &&
-	git checkout -b master2 &&
+	git checkout -b main2 &&
 	git merge -s ours --no-commit gui/master &&
 	git read-tree --prefix=git-gui2/ -u gui/master &&
 	git commit -m "Merge git-gui2 as our subdirectory" &&
@@ -125,8 +125,8 @@ test_expect_success 'initial ambiguous subtree' '
 
 test_expect_success 'merge using explicit' '
 	cd ../git &&
-	git reset --hard master2 &&
-	git pull -Xsubtree=git-gui gui master2 &&
+	git reset --hard main2 &&
+	git pull -Xsubtree=git-gui gui main2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o3 0	git-gui/git-gui.sh" &&
@@ -138,8 +138,8 @@ test_expect_success 'merge using explicit' '
 
 test_expect_success 'merge2 using explicit' '
 	cd ../git &&
-	git reset --hard master2 &&
-	git pull -Xsubtree=git-gui2 gui master2 &&
+	git reset --hard main2 &&
+	git pull -Xsubtree=git-gui2 gui main2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	git-gui/git-gui.sh" &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 5/5] t9902: avoid using the branch name `master`
  2020-09-16 18:10 [PATCH 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
                   ` (3 preceding siblings ...)
  2020-09-16 18:10 ` [PATCH 4/5] tests: " Johannes Schindelin via GitGitGadget
@ 2020-09-16 18:10 ` Johannes Schindelin via GitGitGadget
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
  5 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-16 18:10 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

The completion tests used that name unnecessarily, and it is a
non-inclusive term, so let's avoid using it here.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9902-completion.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 8425b9a531..7b7bc6e4bd 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -542,37 +542,37 @@ test_expect_success '__gitcomp - doesnt fail because of invalid variable name' '
 '
 
 read -r -d "" refs <<-\EOF
+main
 maint
-master
 next
 seen
 EOF
 
 test_expect_success '__gitcomp_nl - trailing space' '
 	test_gitcomp_nl "m" "$refs" <<-EOF
+	main Z
 	maint Z
-	master Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - prefix' '
 	test_gitcomp_nl "--fixup=m" "$refs" "--fixup=" "m" <<-EOF
+	--fixup=main Z
 	--fixup=maint Z
-	--fixup=master Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - suffix' '
 	test_gitcomp_nl "branch.ma" "$refs" "branch." "ma" "." <<-\EOF
+	branch.main.Z
 	branch.maint.Z
-	branch.master.Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - no suffix' '
 	test_gitcomp_nl "ma" "$refs" "" "ma" "" <<-\EOF
+	mainZ
 	maintZ
-	masterZ
 	EOF
 '
 
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH 2/5] t/test-terminal: avoid non-inclusive language
  2020-09-16 18:10 ` [PATCH 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
@ 2020-09-16 21:05   ` Junio C Hamano
  2020-09-16 21:25     ` Junio C Hamano
  0 siblings, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2020-09-16 21:05 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> In the ongoing effort to make the Git project a more inclusive place,
> let's try to avoid names like "master" where possible.

The two sides of a PTY are called 'master' and 'slave', and I
understand there is a push to move away from these words, but
calling one side with an invented name that is used by nobody else
in the context of talking about PTY, while keeping the word used to
call the other side, would lead to confusion.

A better change is to drop "master_" altogether without replacing
the word with anything, and call them just "input", "output" and
"error".  For those who implement the PTY, calling both ends of the
pipe 'master' vs 'slave' may be useful for them, as they are terms
of art they are used to think with.  But as end-users of PTY, the
fact that we are holding the 'master' end, and access to the 'slave'
end is done by asking the 'master' end we hold for the corresponding
'slave', is not that important.  What each of these three PTYs is
used for is much more important.

If $input, $output, and $error are too terse, spell them out as
$term_input, $term_output and $term_error or something like that,
perhaps.

Thanks.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 1/5] fast-export: avoid using unnecessary language in a code comment
  2020-09-16 18:10 ` [PATCH 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
@ 2020-09-16 21:05   ` Junio C Hamano
  0 siblings, 0 replies; 38+ messages in thread
From: Junio C Hamano @ 2020-09-16 21:05 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> In an ongoing effort to avoid non-inclusive language, let's avoid using
> the branch name "master" in a code comment.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  builtin/fast-export.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/fast-export.c b/builtin/fast-export.c
> index 1b8fca3ee0..5527135ba8 100644
> --- a/builtin/fast-export.c
> +++ b/builtin/fast-export.c
> @@ -1026,7 +1026,7 @@ static void handle_tags_and_duplicates(struct string_list *extras)
>  				/*
>  				 * Getting here means we have a commit which
>  				 * was excluded by a negative refspec (e.g.
> -				 * fast-export ^master master).  If we are
> +				 * fast-export ^HEAD HEAD).  If we are

Obviously good change.  Thanks.

>  				 * referencing excluded commits, set the ref
>  				 * to the exact commit.  Otherwise, the user
>  				 * wants the branch exported but every commit

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 3/5] t3200: avoid variations of the `master` branch name
  2020-09-16 18:10 ` [PATCH 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
@ 2020-09-16 21:11   ` Jeff King
  2020-09-16 22:28     ` Junio C Hamano
  0 siblings, 1 reply; 38+ messages in thread
From: Jeff King @ 2020-09-16 21:11 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

On Wed, Sep 16, 2020 at 06:10:51PM +0000, Johannes Schindelin via GitGitGadget wrote:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> To avoid branch names with a loaded history, we already started to avoid
> using the name "master" in a couple instances.
> 
> The `t3200-branch.sh` script uses variations of this name for branches
> other than the default one. So let's change those names, as
> "lowest-hanging fruits" in the effort to use more inclusive naming
> throughout Git's source code.

A few of these are kind of odd after only this patch. E.g.:

> -test_expect_success 'git branch -M master2 master2 should work when master is checked out' '
> +test_expect_success 'git branch -M main2 main2 should work when master is checked out' '
>  	git checkout master &&
> -	git branch master2 &&
> -	git branch -M master2 master2
> +	git branch main2 &&
> +	git branch -M main2 main2
>  '

The point of "master2" is that it wasn't "master". But now "main2" is
kind of a weird name, because it has a "2" but isn't related to
anything. If we eventually move the base branch name to "main", they'll
line up again.

I'm on the fence on whether this matters. It's a temporary
inconsistency, assuming we eventually move to "main" as the default. We
_could_ push this change off to that patch, too, but it does make it
more noisy.

But it may be that the connection to "master" here is not all that
important in the first place. And so perhaps an even better patch (both
at this stage and in the long run) is to give it a more descriptive
name. If all of these could just be "branch2", "branch3", etc, then that
alone would be better than "master2", IMHO. I'm not sure if the shared
"ma" prefix matters, though (I know in some tests it does because we're
testing glob matching).

Again, I'm on the fence whether this is exploring too deeply. It's an
opportunity to improve the tests while we're changing them. But at the
same time, I doubt anybody cares too much overall, so it feels a bit
like make-work.

-Peff

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 2/5] t/test-terminal: avoid non-inclusive language
  2020-09-16 21:05   ` Junio C Hamano
@ 2020-09-16 21:25     ` Junio C Hamano
  2020-09-20 15:34       ` Johannes Schindelin
  0 siblings, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2020-09-16 21:25 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

Junio C Hamano <gitster@pobox.com> writes:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
>> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>>
>> In the ongoing effort to make the Git project a more inclusive place,
>> let's try to avoid names like "master" where possible.
>
> The two sides of a PTY are called 'master' and 'slave', and I
> understand there is a push to move away from these words, but
> calling one side with an invented name that is used by nobody else
> in the context of talking about PTY, while keeping the word used to
> call the other side, would lead to confusion.
>
> A better change is to drop "master_" altogether without replacing
> the word with anything, and call them just "input", "output" and
> "error".

If we really want to use a replacement word for 'master' instead of
just dropping, I may be inclined to suggest 'parent', in the hope
that PTY implementors will start following what Python folks are
doing, at which time they will give us a synonym for 'slave' method
called 'child' we can use.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 3/5] t3200: avoid variations of the `master` branch name
  2020-09-16 21:11   ` Jeff King
@ 2020-09-16 22:28     ` Junio C Hamano
  2020-09-16 22:39       ` Jeff King
  0 siblings, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2020-09-16 22:28 UTC (permalink / raw)
  To: Jeff King; +Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Jeff King <peff@peff.net> writes:

> I'm on the fence on whether this matters. It's a temporary
> inconsistency, assuming we eventually move to "main" as the default. We
> _could_ push this change off to that patch, too, but it does make it
> more noisy.

Another way to handle this is perhaps to teach test-lib.sh a way to
tell it that we want to live in the world where the initial default
branch name is 'main' and use that at the beginning of these select
test scripts like t3200.  Then we can do three related things in a
single patch to t3200, which are:

 - Declare that any "git init" in this test (including the initial
   one) uses 'main' as the default branch name;

 - rename 'master' used in the test to 'main'

 - rename 'master2' used in the test to 'main2'

and it would eliminate the awkwardness.

The change to test-lib.sh would likely to use init.defaultBranch
which also would be a good thing.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 3/5] t3200: avoid variations of the `master` branch name
  2020-09-16 22:28     ` Junio C Hamano
@ 2020-09-16 22:39       ` Jeff King
  2020-09-20 15:43         ` Johannes Schindelin
  0 siblings, 1 reply; 38+ messages in thread
From: Jeff King @ 2020-09-16 22:39 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

On Wed, Sep 16, 2020 at 03:28:21PM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > I'm on the fence on whether this matters. It's a temporary
> > inconsistency, assuming we eventually move to "main" as the default. We
> > _could_ push this change off to that patch, too, but it does make it
> > more noisy.
> 
> Another way to handle this is perhaps to teach test-lib.sh a way to
> tell it that we want to live in the world where the initial default
> branch name is 'main' and use that at the beginning of these select
> test scripts like t3200.  Then we can do three related things in a
> single patch to t3200, which are:
> 
>  - Declare that any "git init" in this test (including the initial
>    one) uses 'main' as the default branch name;
> 
>  - rename 'master' used in the test to 'main'
> 
>  - rename 'master2' used in the test to 'main2'
> 
> and it would eliminate the awkwardness.
> 
> The change to test-lib.sh would likely to use init.defaultBranch
> which also would be a good thing.

Yeah, I'd be perfectly happy with that.

-Peff

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 2/5] t/test-terminal: avoid non-inclusive language
  2020-09-16 21:25     ` Junio C Hamano
@ 2020-09-20 15:34       ` Johannes Schindelin
  2020-09-21 21:12         ` Junio C Hamano
  0 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin @ 2020-09-20 15:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git

Hi Junio,

On Wed, 16 Sep 2020, Junio C Hamano wrote:

> Junio C Hamano <gitster@pobox.com> writes:
>
> > "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> > writes:
> >
> >> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >>
> >> In the ongoing effort to make the Git project a more inclusive place,
> >> let's try to avoid names like "master" where possible.
> >
> > The two sides of a PTY are called 'master' and 'slave', and I
> > understand there is a push to move away from these words, but
> > calling one side with an invented name that is used by nobody else
> > in the context of talking about PTY, while keeping the word used to
> > call the other side, would lead to confusion.
> >
> > A better change is to drop "master_" altogether without replacing
> > the word with anything, and call them just "input", "output" and
> > "error".
>
> If we really want to use a replacement word for 'master' instead of
> just dropping, I may be inclined to suggest 'parent', in the hope
> that PTY implementors will start following what Python folks are
> doing, at which time they will give us a synonym for 'slave' method
> called 'child' we can use.

Good idea!

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 3/5] t3200: avoid variations of the `master` branch name
  2020-09-16 22:39       ` Jeff King
@ 2020-09-20 15:43         ` Johannes Schindelin
  2020-09-21 21:26           ` Junio C Hamano
  0 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin @ 2020-09-20 15:43 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, Johannes Schindelin via GitGitGadget, git

Hi Junio & Peff,

On Wed, 16 Sep 2020, Jeff King wrote:

> On Wed, Sep 16, 2020 at 03:28:21PM -0700, Junio C Hamano wrote:
>
> > Jeff King <peff@peff.net> writes:
> >
> > > I'm on the fence on whether this matters. It's a temporary
> > > inconsistency, assuming we eventually move to "main" as the default.
> > > We _could_ push this change off to that patch, too, but it does make
> > > it more noisy.
> >
> > Another way to handle this is perhaps to teach test-lib.sh a way to
> > tell it that we want to live in the world where the initial default
> > branch name is 'main' and use that at the beginning of these select
> > test scripts like t3200.  Then we can do three related things in a
> > single patch to t3200, which are:
> >
> >  - Declare that any "git init" in this test (including the initial
> >    one) uses 'main' as the default branch name;
> >
> >  - rename 'master' used in the test to 'main'
> >
> >  - rename 'master2' used in the test to 'main2'
> >
> > and it would eliminate the awkwardness.
> >
> > The change to test-lib.sh would likely to use init.defaultBranch
> > which also would be a good thing.
>
> Yeah, I'd be perfectly happy with that.

I do want to introduce something like that in the patch series after the
next one.

However, in this instance, I think it makes more sense to use a separate
name altogether. I settled for using `topic` instead of `main2`, and
`new-topic` instead of `main3` locally.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 2/5] t/test-terminal: avoid non-inclusive language
  2020-09-20 15:34       ` Johannes Schindelin
@ 2020-09-21 21:12         ` Junio C Hamano
  0 siblings, 0 replies; 38+ messages in thread
From: Junio C Hamano @ 2020-09-21 21:12 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Johannes Schindelin via GitGitGadget, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Junio,
>
> On Wed, 16 Sep 2020, Junio C Hamano wrote:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>> > "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
>> > writes:
>> >
>> >> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>> >>
>> >> In the ongoing effort to make the Git project a more inclusive place,
>> >> let's try to avoid names like "master" where possible.
>> >
>> > The two sides of a PTY are called 'master' and 'slave', and I
>> > understand there is a push to move away from these words, but
>> > calling one side with an invented name that is used by nobody else
>> > in the context of talking about PTY, while keeping the word used to
>> > call the other side, would lead to confusion.
>> >
>> > A better change is to drop "master_" altogether without replacing
>> > the word with anything, and call them just "input", "output" and
>> > "error".
>>
>> If we really want to use a replacement word for 'master' instead of
>> just dropping, I may be inclined to suggest 'parent', in the hope
>> that PTY implementors will start following what Python folks are
>> doing, at which time they will give us a synonym for 'slave' method
>> called 'child' we can use.
>
> Good idea!

It is unclear which one of the two you thought a good idea.

Hopefully both are good, but simply dropping "master_" without
attempting to replace would probably be better.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 3/5] t3200: avoid variations of the `master` branch name
  2020-09-20 15:43         ` Johannes Schindelin
@ 2020-09-21 21:26           ` Junio C Hamano
  0 siblings, 0 replies; 38+ messages in thread
From: Junio C Hamano @ 2020-09-21 21:26 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jeff King, Johannes Schindelin via GitGitGadget, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> > Jeff King <peff@peff.net> writes:
>> >
>> > > I'm on the fence on whether this matters. It's a temporary
>> > > inconsistency, assuming we eventually move to "main" as the default.
>> > > We _could_ push this change off to that patch, too, but it does make
>> > > it more noisy.
>> > ...
> However, in this instance, I think it makes more sense to use a separate
> name altogether. I settled for using `topic` instead of `main2`, and
> `new-topic` instead of `main3` locally.

I think that is sensible.  Configuration does not have to be used as
an escape hatch to make 'main2' less awkward---if we can avoid
'main2' (or 'master2'), that would be sufficient.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 0/5] Inclusive naming, part II
  2020-09-16 18:10 [PATCH 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
                   ` (4 preceding siblings ...)
  2020-09-16 18:10 ` [PATCH 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:01 ` Johannes Schindelin via GitGitGadget
  2020-09-21 22:01   ` [PATCH v2 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
                     ` (6 more replies)
  5 siblings, 7 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-21 22:01 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Johannes Schindelin, Johannes Schindelin

This patch series represents the logical next step on the journey begun with
introducing init.defaultBranch: in these patches, we avoid a couple
unnecessary mentions of the branch name "master".

This patch series does not try to change the default branch name, although I
have that patch series ready to go. You can see the overall idea here: 
https://github.com/gitgitgadget/git/pull/655. Concretely, I plan on
submitting three more patch series after this one:

 1. a relatively small patch series to avoid using the branch name main in
    the test suite. This is necessary because my plan is to change the
    default branch name to that name, therefore it cannot be used as the
    name of a topic branch any longer.
 2. a relatively large patch series (currently consisting of 18 patches) to
    change the default branch name to main. Most of the patches provide
    non-trivial (read: non-scriptable) adjustments to the test suite in an
    incremental fashion, with a big patch toward the end that reflects a
    fully-automated search-and-replace of all the trivial cases.
 3. a very small patch series with fall-out patches that are not necessary
    to pass the test suite, but are still required to complete the rename
    (adjusted code comment, file rename).

(Note: I am still debating whether I should move one or two patches from the
second to the third patch series)

Changes since v1:

 * Instead of using the name primary for the adjustments to 
   t/test-terminal.perl, we follow Python's lead (which uses the
   parent/child nomenclature).
 * The changes to t3200 no longer use variations of the name main as branch
   names; Instead, the renamed branches are independent from any current or
   future default branch name.

Johannes Schindelin (5):
  fast-export: avoid using unnecessary language in a code comment
  t/test-terminal: avoid non-inclusive language
  t3200: avoid variations of the `master` branch name
  tests: avoid variations of the `master` branch name
  t9902: avoid using the branch name `master`

 builtin/fast-export.c        |  2 +-
 t/t3200-branch.sh            | 34 ++++++++++++++---------------
 t/t3427-rebase-subtree.sh    | 42 ++++++++++++++++++------------------
 t/t4150-am.sh                |  8 +++----
 t/t5515-fetch-merge-logic.sh |  6 +++---
 t/t5523-push-upstream.sh     | 20 ++++++++---------
 t/t6018-rev-list-glob.sh     |  6 +++---
 t/t6040-tracking-info.sh     | 20 ++++++++---------
 t/t6409-merge-subtree.sh     | 14 ++++++------
 t/t9902-completion.sh        | 10 ++++-----
 t/test-terminal.perl         | 32 +++++++++++++--------------
 11 files changed, 97 insertions(+), 97 deletions(-)


base-commit: 54e85e7af1ac9e9a92888060d6811ae767fea1bc
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-734%2Fdscho%2Favoid-unnecessary-branch-name-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-734/dscho/avoid-unnecessary-branch-name-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/734

Range-diff vs v1:

 1:  587ddca42a = 1:  587ddca42a fast-export: avoid using unnecessary language in a code comment
 2:  3b4ae48d4a ! 2:  80e1d46cce t/test-terminal: avoid non-inclusive language
     @@ Commit message
          least we can get rid of the usage of the word `master` and hope that
          IO::Pty will be eventually adjusted, too.
      
     +    Guessing that IO::Pty might follow Python's lead, we replace the name
     +    `master` by `parent` (hoping that IO::Pty will adopt the parent/child
     +    nomenclature, too).
     +
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/test-terminal.perl ##
     @@ t/test-terminal.perl: sub copy_stdio {
      -close $master_err->slave;
      -my $in_pid = copy_stdin($master_in);
      -copy_stdio($master_out, $master_err);
     -+my $primary_in = new IO::Pty;
     -+my $primary_out = new IO::Pty;
     -+my $primary_err = new IO::Pty;
     -+$primary_in->set_raw();
     -+$primary_out->set_raw();
     -+$primary_err->set_raw();
     -+$primary_in->slave->set_raw();
     -+$primary_out->slave->set_raw();
     -+$primary_err->slave->set_raw();
     -+my $pid = start_child(\@ARGV, $primary_in->slave, $primary_out->slave, $primary_err->slave);
     -+close $primary_in->slave;
     -+close $primary_out->slave;
     -+close $primary_err->slave;
     -+my $in_pid = copy_stdin($primary_in);
     -+copy_stdio($primary_out, $primary_err);
     ++my $parent_in = new IO::Pty;
     ++my $parent_out = new IO::Pty;
     ++my $parent_err = new IO::Pty;
     ++$parent_in->set_raw();
     ++$parent_out->set_raw();
     ++$parent_err->set_raw();
     ++$parent_in->slave->set_raw();
     ++$parent_out->slave->set_raw();
     ++$parent_err->slave->set_raw();
     ++my $pid = start_child(\@ARGV, $parent_in->slave, $parent_out->slave, $parent_err->slave);
     ++close $parent_in->slave;
     ++close $parent_out->slave;
     ++close $parent_err->slave;
     ++my $in_pid = copy_stdin($parent_in);
     ++copy_stdio($parent_out, $parent_err);
       my $ret = finish_child($pid);
       # If the child process terminates before our copy_stdin() process is able to
      -# write all of its data to $master_in, the copy_stdin() process could stall.
     -+# write all of its data to $primary_in, the copy_stdin() process could stall.
     ++# write all of its data to $parent_in, the copy_stdin() process could stall.
       # Send SIGTERM to it to ensure it terminates.
       kill 'TERM', $in_pid;
       finish_child($in_pid);
 3:  2f1d0a2df4 ! 3:  8d8e9abfe2 t3200: avoid variations of the `master` branch name
     @@ Commit message
          The `t3200-branch.sh` script uses variations of this name for branches
          other than the default one. So let's change those names, as
          "lowest-hanging fruits" in the effort to use more inclusive naming
     -    throughout Git's source code.
     +    throughout Git's source code. While at it, make those branch names
     +    independent from the default branch name.
      
     -    In this particular instance, this requires a couple of non-trivial
     -    adjustments, as the aligned output depends on the maximum length of the
     -    displayed branches (which we now changed), and also on the alphabetical
     -    order (which we now changed, too).
     +    In this particular instance, this rename requires a couple of
     +    non-trivial adjustments, as the aligned output depends on the maximum
     +    length of the displayed branches (which we now changed), and also on the
     +    alphabetical order (which we now changed, too).
      
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
     @@ t/t3200-branch.sh: test_expect_success 'git branch -M master master should work
       '
       
      -test_expect_success 'git branch -M master2 master2 should work when master is checked out' '
     -+test_expect_success 'git branch -M main2 main2 should work when master is checked out' '
     ++test_expect_success 'git branch -M topic topic should work when master is checked out' '
       	git checkout master &&
      -	git branch master2 &&
      -	git branch -M master2 master2
     -+	git branch main2 &&
     -+	git branch -M main2 main2
     ++	git branch topic &&
     ++	git branch -M topic topic
       '
       
       test_expect_success 'git branch -v -d t should work' '
     @@ t/t3200-branch.sh: test_expect_success 'git branch --list -v with --abbrev' '
       	cat >expect <<\EOF &&
      -  a/b/c     bam       foo       l       * master    mb        o/o       q
      -  abc       bar       j/k       m/m       master2   n         o/p       r
     -+  a/b/c    bam      foo      l        main2    mb       o/o      q
     -+  abc      bar      j/k      m/m    * master   n        o/p      r
     ++  a/b/c    bam      foo      l      * master   n        o/p      r
     ++  abc      bar      j/k      m/m      mb       o/o      q        topic
       EOF
       	test_cmp expect actual
       '
      @@ t/t3200-branch.sh: test_expect_success 'git branch --column with an extremely long branch name' '
     -   j/k
         l
         m/m
     -+  main2
       * master
      -  master2
         mb
         n
         o/o
     +   o/p
     +   q
     +   r
     ++  topic
     +   $long
     + EOF
     + 	test_cmp expect actual
      @@ t/t3200-branch.sh: test_expect_success 'git branch with column.*' '
       	git config --unset column.branch &&
       	git config --unset column.ui &&
       	cat >expect <<\EOF &&
      -  a/b/c   bam   foo   l   * master    mb   o/o   q
      -  abc     bar   j/k   m/m   master2   n    o/p   r
     -+  a/b/c   bam   foo   l     main2    mb   o/o   q
     -+  abc     bar   j/k   m/m * master   n    o/p   r
     ++  a/b/c   bam   foo   l   * master   n     o/p   r
     ++  abc     bar   j/k   m/m   mb       o/o   q     topic
       EOF
       	test_cmp expect actual
       '
     @@ t/t3200-branch.sh: test_expect_success 'git branch --column -v should fail' '
       	cat >expect <<\EOF &&
         a/b/c
      @@ t/t3200-branch.sh: test_expect_success 'git branch -v with column.ui ignored' '
     -   j/k
         l
         m/m
     -+  main2
       * master
      -  master2
         mb
         n
         o/o
     +   o/p
     +   q
     +   r
     ++  topic
     + EOF
     + 	test_cmp expect actual
     + '
      @@ t/t3200-branch.sh: test_expect_success 'git branch -C master master should work when master is chec
       	git branch -C master master
       '
     @@ t/t3200-branch.sh: test_expect_success 'deleting a self-referential symref' '
      -	git symbolic-ref refs/heads/master2 refs/heads/master &&
      -	test_must_fail git branch -m master2 master3 &&
      -	git symbolic-ref refs/heads/master2 &&
     -+	git symbolic-ref refs/heads/main2 refs/heads/master &&
     -+	test_must_fail git branch -m main2 main3 &&
     -+	git symbolic-ref refs/heads/main2 &&
     ++	git symbolic-ref refs/heads/topic refs/heads/master &&
     ++	test_must_fail git branch -m topic new-topic &&
     ++	git symbolic-ref refs/heads/topic &&
       	test_path_is_file .git/refs/heads/master &&
      -	test_path_is_missing .git/refs/heads/master3
     -+	test_path_is_missing .git/refs/heads/main3
     ++	test_path_is_missing .git/refs/heads/new-topic
       '
       
       test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '
 4:  a532053e60 = 4:  8f59e19b95 tests: avoid variations of the `master` branch name
 5:  d135a8423b = 5:  c2c1238b5d t9902: avoid using the branch name `master`

-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v2 1/5] fast-export: avoid using unnecessary language in a code comment
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:01   ` Johannes Schindelin via GitGitGadget
  2020-09-21 22:01   ` [PATCH v2 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-21 22:01 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In an ongoing effort to avoid non-inclusive language, let's avoid using
the branch name "master" in a code comment.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 builtin/fast-export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 1b8fca3ee0..5527135ba8 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -1026,7 +1026,7 @@ static void handle_tags_and_duplicates(struct string_list *extras)
 				/*
 				 * Getting here means we have a commit which
 				 * was excluded by a negative refspec (e.g.
-				 * fast-export ^master master).  If we are
+				 * fast-export ^HEAD HEAD).  If we are
 				 * referencing excluded commits, set the ref
 				 * to the exact commit.  Otherwise, the user
 				 * wants the branch exported but every commit
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 2/5] t/test-terminal: avoid non-inclusive language
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
  2020-09-21 22:01   ` [PATCH v2 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:01   ` Johannes Schindelin via GitGitGadget
  2020-09-21 22:01   ` [PATCH v2 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-21 22:01 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In the ongoing effort to make the Git project a more inclusive place,
let's try to avoid names like "master" where possible.

In this instance, the use of the term `slave` is unfortunately enshrined
in IO::Pty's API. We simply cannot avoid using that word here. But at
least we can get rid of the usage of the word `master` and hope that
IO::Pty will be eventually adjusted, too.

Guessing that IO::Pty might follow Python's lead, we replace the name
`master` by `parent` (hoping that IO::Pty will adopt the parent/child
nomenclature, too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/test-terminal.perl | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/t/test-terminal.perl b/t/test-terminal.perl
index 46bf618479..1bcf01a9a4 100755
--- a/t/test-terminal.perl
+++ b/t/test-terminal.perl
@@ -81,24 +81,24 @@ sub copy_stdio {
 	die "usage: test-terminal program args";
 }
 $ENV{TERM} = 'vt100';
-my $master_in = new IO::Pty;
-my $master_out = new IO::Pty;
-my $master_err = new IO::Pty;
-$master_in->set_raw();
-$master_out->set_raw();
-$master_err->set_raw();
-$master_in->slave->set_raw();
-$master_out->slave->set_raw();
-$master_err->slave->set_raw();
-my $pid = start_child(\@ARGV, $master_in->slave, $master_out->slave, $master_err->slave);
-close $master_in->slave;
-close $master_out->slave;
-close $master_err->slave;
-my $in_pid = copy_stdin($master_in);
-copy_stdio($master_out, $master_err);
+my $parent_in = new IO::Pty;
+my $parent_out = new IO::Pty;
+my $parent_err = new IO::Pty;
+$parent_in->set_raw();
+$parent_out->set_raw();
+$parent_err->set_raw();
+$parent_in->slave->set_raw();
+$parent_out->slave->set_raw();
+$parent_err->slave->set_raw();
+my $pid = start_child(\@ARGV, $parent_in->slave, $parent_out->slave, $parent_err->slave);
+close $parent_in->slave;
+close $parent_out->slave;
+close $parent_err->slave;
+my $in_pid = copy_stdin($parent_in);
+copy_stdio($parent_out, $parent_err);
 my $ret = finish_child($pid);
 # If the child process terminates before our copy_stdin() process is able to
-# write all of its data to $master_in, the copy_stdin() process could stall.
+# write all of its data to $parent_in, the copy_stdin() process could stall.
 # Send SIGTERM to it to ensure it terminates.
 kill 'TERM', $in_pid;
 finish_child($in_pid);
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 3/5] t3200: avoid variations of the `master` branch name
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
  2020-09-21 22:01   ` [PATCH v2 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
  2020-09-21 22:01   ` [PATCH v2 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:01   ` Johannes Schindelin via GitGitGadget
  2020-09-21 22:01   ` [PATCH v2 4/5] tests: " Johannes Schindelin via GitGitGadget
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-21 22:01 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

To avoid branch names with a loaded history, we already started to avoid
using the name "master" in a couple instances.

The `t3200-branch.sh` script uses variations of this name for branches
other than the default one. So let's change those names, as
"lowest-hanging fruits" in the effort to use more inclusive naming
throughout Git's source code. While at it, make those branch names
independent from the default branch name.

In this particular instance, this rename requires a couple of
non-trivial adjustments, as the aligned output depends on the maximum
length of the displayed branches (which we now changed), and also on the
alphabetical order (which we now changed, too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3200-branch.sh | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 4c0734157b..cc27e3bfdb 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -234,10 +234,10 @@ test_expect_success 'git branch -M master master should work when master is chec
 	git branch -M master master
 '
 
-test_expect_success 'git branch -M master2 master2 should work when master is checked out' '
+test_expect_success 'git branch -M topic topic should work when master is checked out' '
 	git checkout master &&
-	git branch master2 &&
-	git branch -M master2 master2
+	git branch topic &&
+	git branch -M topic topic
 '
 
 test_expect_success 'git branch -v -d t should work' '
@@ -324,8 +324,8 @@ test_expect_success 'git branch --list -v with --abbrev' '
 test_expect_success 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expect <<\EOF &&
-  a/b/c     bam       foo       l       * master    mb        o/o       q
-  abc       bar       j/k       m/m       master2   n         o/p       r
+  a/b/c    bam      foo      l      * master   n        o/p      r
+  abc      bar      j/k      m/m      mb       o/o      q        topic
 EOF
 	test_cmp expect actual
 '
@@ -346,13 +346,13 @@ test_expect_success 'git branch --column with an extremely long branch name' '
   l
   m/m
 * master
-  master2
   mb
   n
   o/o
   o/p
   q
   r
+  topic
   $long
 EOF
 	test_cmp expect actual
@@ -365,8 +365,8 @@ test_expect_success 'git branch with column.*' '
 	git config --unset column.branch &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
-  a/b/c   bam   foo   l   * master    mb   o/o   q
-  abc     bar   j/k   m/m   master2   n    o/p   r
+  a/b/c   bam   foo   l   * master   n     o/p   r
+  abc     bar   j/k   m/m   mb       o/o   q     topic
 EOF
 	test_cmp expect actual
 '
@@ -377,7 +377,7 @@ test_expect_success 'git branch --column -v should fail' '
 
 test_expect_success 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
-	COLUMNS=80 git branch -v | cut -c -10 | sed "s/ *$//" >actual &&
+	COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
   a/b/c
@@ -389,13 +389,13 @@ test_expect_success 'git branch -v with column.ui ignored' '
   l
   m/m
 * master
-  master2
   mb
   n
   o/o
   o/p
   q
   r
+  topic
 EOF
 	test_cmp expect actual
 '
@@ -597,10 +597,10 @@ test_expect_success 'git branch -C master master should work when master is chec
 	git branch -C master master
 '
 
-test_expect_success 'git branch -C master5 master5 should work when master is checked out' '
+test_expect_success 'git branch -C main5 main5 should work when master is checked out' '
 	git checkout master &&
-	git branch master5 &&
-	git branch -C master5 master5
+	git branch main5 &&
+	git branch -C main5 main5
 '
 
 test_expect_success 'git branch -C ab cd should overwrite existing config for cd' '
@@ -711,11 +711,11 @@ test_expect_success 'deleting a self-referential symref' '
 '
 
 test_expect_success 'renaming a symref is not allowed' '
-	git symbolic-ref refs/heads/master2 refs/heads/master &&
-	test_must_fail git branch -m master2 master3 &&
-	git symbolic-ref refs/heads/master2 &&
+	git symbolic-ref refs/heads/topic refs/heads/master &&
+	test_must_fail git branch -m topic new-topic &&
+	git symbolic-ref refs/heads/topic &&
 	test_path_is_file .git/refs/heads/master &&
-	test_path_is_missing .git/refs/heads/master3
+	test_path_is_missing .git/refs/heads/new-topic
 '
 
 test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 4/5] tests: avoid variations of the `master` branch name
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
                     ` (2 preceding siblings ...)
  2020-09-21 22:01   ` [PATCH v2 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:01   ` Johannes Schindelin via GitGitGadget
  2020-09-21 22:31     ` Junio C Hamano
  2020-09-21 22:01   ` [PATCH v2 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
                     ` (2 subsequent siblings)
  6 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-21 22:01 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

The term `master` has a loaded history that serves as a constant
reminder of racial injustice. The Git project has no desire to
perpetuate this and already started avoiding it.

The test suite uses variations of this name for branches other than the
default one. Apart from t3200, where we just addressed this in the
previous commit, those instances can be renamed in an automated manner
because they do not require any changes outside of the test script, so
let's do that.

Seeing as `main` seems to be materializing as the favorite default
branch name of many Open Source projects, we use that name in our
replacements, too.

This trick was performed by this (GNU) sed invocation:

	$ sed -i 's/master\([a-z0-9]\)/main\1/g' t/t*.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3427-rebase-subtree.sh    | 42 ++++++++++++++++++------------------
 t/t4150-am.sh                |  8 +++----
 t/t5515-fetch-merge-logic.sh |  6 +++---
 t/t5523-push-upstream.sh     | 20 ++++++++---------
 t/t6018-rev-list-glob.sh     |  6 +++---
 t/t6040-tracking-info.sh     | 20 ++++++++---------
 t/t6409-merge-subtree.sh     | 14 ++++++------
 7 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 79e43a370b..ba27e9d603 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -15,12 +15,12 @@ commit_message() {
 # this test script tries to document them.  First, the following commit history
 # is generated (the onelines are shown, time flows from left to right):
 #
-# master1 - master2 - master3
+# main1 - main2 - main3
 #                             \
-# README ---------------------- Add subproject master - master4 - files_subtree/master5
+# README ---------------------- Add subproject master - main4 - files_subtree/main5
 #
 # Where the merge moves the files master[123].t into the subdirectory
-# files_subtree/ and master4 as well as files_subtree/master5 add files to that
+# files_subtree/ and main4 as well as files_subtree/main5 add files to that
 # directory directly.
 #
 # Then, in subsequent test cases, `git filter-branch` is used to distill just
@@ -28,11 +28,11 @@ commit_message() {
 # an empty commit is added on top. The pre-rebase commit history looks like
 # this:
 #
-# Add subproject master - master4 - files_subtree/master5 - Empty commit
+# Add subproject master - main4 - files_subtree/main5 - Empty commit
 #
-# where the root commit adds three files: master1.t, master2.t and master3.t.
+# where the root commit adds three files: main1.t, main2.t and main3.t.
 #
-# This commit history is then rebased onto `master3` with the
+# This commit history is then rebased onto `main3` with the
 # `-Xsubtree=files_subtree` option in three different ways:
 #
 # 1. using `--preserve-merges`
@@ -43,9 +43,9 @@ test_expect_success 'setup' '
 	test_commit README &&
 
 	git init files &&
-	test_commit -C files master1 &&
-	test_commit -C files master2 &&
-	test_commit -C files master3 &&
+	test_commit -C files main1 &&
+	test_commit -C files main2 &&
+	test_commit -C files main3 &&
 
 	: perform subtree merge into files_subtree/ &&
 	git fetch files refs/heads/master:refs/heads/files-master &&
@@ -55,8 +55,8 @@ test_expect_success 'setup' '
 	git commit -m "Add subproject master" &&
 
 	: add two extra commits to rebase &&
-	test_commit -C files_subtree master4 &&
-	test_commit files_subtree/master5 &&
+	test_commit -C files_subtree main4 &&
+	test_commit files_subtree/main5 &&
 
 	git checkout -b to-rebase &&
 	git fast-export --no-data HEAD -- files_subtree/ |
@@ -66,22 +66,22 @@ test_expect_success 'setup' '
 	git commit -m "Empty commit" --allow-empty
 '
 
-# FAILURE: Does not preserve master4.
+# FAILURE: Does not preserve main4.
 test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-preserve-merges to-rebase &&
 	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
-	verbose test "$(commit_message HEAD~)" = "master4" &&
-	verbose test "$(commit_message HEAD)" = "files_subtree/master5"
+	verbose test "$(commit_message HEAD~)" = "main4" &&
+	verbose test "$(commit_message HEAD)" = "files_subtree/main5"
 '
 
-# FAILURE: Does not preserve master4.
+# FAILURE: Does not preserve main4.
 test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-keep-empty to-rebase &&
 	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "main4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
@@ -91,8 +91,8 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-master master &&
 	: first pick results in no changes &&
 	git rebase --skip &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "main4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
@@ -102,8 +102,8 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit'
 	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-master --root &&
 	: first pick results in no changes &&
 	git rebase --skip &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "main4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 1da8ab120b..3d8dc7eb12 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -465,7 +465,7 @@ test_expect_success 'am changes committer and keeps author' '
 test_expect_success 'am --signoff adds Signed-off-by: line' '
 	rm -fr .git/rebase-apply &&
 	git reset --hard &&
-	git checkout -b master2 first &&
+	git checkout -b main2 first &&
 	git am --signoff <patch2 &&
 	{
 		printf "third\n\nSigned-off-by: %s <%s>\n\n" \
@@ -479,7 +479,7 @@ test_expect_success 'am --signoff adds Signed-off-by: line' '
 '
 
 test_expect_success 'am stays in branch' '
-	echo refs/heads/master2 >expected &&
+	echo refs/heads/main2 >expected &&
 	git symbolic-ref HEAD >actual &&
 	test_cmp expected actual
 '
@@ -540,7 +540,7 @@ test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '
 	git reset --hard HEAD^ &&
 	git am <patch4 &&
 	git rev-parse HEAD >expected &&
-	git rev-parse master2 >actual &&
+	git rev-parse main2 >actual &&
 	test_cmp expected actual
 '
 
@@ -567,7 +567,7 @@ test_expect_success 'am --keep-non-patch really keeps the non-patch part' '
 test_expect_success 'setup am -3' '
 	rm -fr .git/rebase-apply &&
 	git reset --hard &&
-	git checkout -b base3way master2 &&
+	git checkout -b base3way main2 &&
 	sed -n -e "3,\$p" msg >file &&
 	head -n 9 msg >>file &&
 	git add file &&
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 9d6a46ff56..b1c18cc993 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -15,7 +15,7 @@ export GIT_TEST_PROTOCOL_VERSION
 
 build_script () {
 	script="$1" &&
-	for i in one three_file master master2 one_tree three two two2 three2
+	for i in one three_file master main2 one_tree three two two2 three2
 	do
 		echo "s/$(test_oid --hash=sha1 "$i")/$(test_oid "$i")/g" >>"$script"
 	done
@@ -52,8 +52,8 @@ test_expect_success setup '
 	two sha1:525b7fb068d59950d185a8779dc957c77eed73ba
 	two sha256:3b21de3440cd38c2a9e9b464adb923f7054949ed4c918e1a0ac4c95cd52774db
 
-	master2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
-	master2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
+	main2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
+	main2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
 
 	two2 sha1:6134ee8f857693b96ff1cc98d3e2fd62b199e5a8
 	two2 sha256:87a2d3ee29c83a3dc7afd41c0606b11f67603120b910a7be7840accdc18344d4
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index c0df81a014..6b5f2e373d 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -41,20 +41,20 @@ test_expect_success 'push -u --dry-run master:otherX' '
 	check_config master upstream refs/heads/other
 '
 
-test_expect_success 'push -u master2:master2' '
-	git branch master2 &&
-	git push -u upstream master2:master2 &&
-	check_config master2 upstream refs/heads/master2
+test_expect_success 'push -u main2:main2' '
+	git branch main2 &&
+	git push -u upstream main2:main2 &&
+	check_config main2 upstream refs/heads/main2
 '
 
-test_expect_success 'push -u master2:other2' '
-	git push -u upstream master2:other2 &&
-	check_config master2 upstream refs/heads/other2
+test_expect_success 'push -u main2:other2' '
+	git push -u upstream main2:other2 &&
+	check_config main2 upstream refs/heads/other2
 '
 
-test_expect_success 'push -u :master2' '
-	git push -u upstream :master2 &&
-	check_config master2 upstream refs/heads/other2
+test_expect_success 'push -u :main2' '
+	git push -u upstream :main2 &&
+	check_config main2 upstream refs/heads/other2
 '
 
 test_expect_success 'push -u --all' '
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index b31ff7eeec..5df38a39e5 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -32,11 +32,11 @@ test_expect_success 'setup' '
 	git checkout -b someref master &&
 	commit some &&
 	git checkout master &&
-	commit master2 &&
+	commit main2 &&
 	git tag foo/bar master &&
-	commit master3 &&
+	commit main3 &&
 	git update-ref refs/remotes/foo/baz master &&
-	commit master4 &&
+	commit main4 &&
 	git update-ref refs/remotes/upstream/one subspace/one &&
 	git update-ref refs/remotes/upstream/two subspace/two &&
 	git update-ref refs/remotes/upstream/x subspace-x &&
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index ad1922b999..946d05c879 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -264,25 +264,25 @@ test_expect_success 'fail to track annotated tags' '
 test_expect_success '--set-upstream-to does not change branch' '
 	git branch from-master master &&
 	git branch --set-upstream-to master from-master &&
-	git branch from-master2 master &&
-	test_must_fail git config branch.from-master2.merge > actual &&
-	git rev-list from-master2 &&
-	git update-ref refs/heads/from-master2 from-master2^ &&
-	git rev-parse from-master2 >expect2 &&
-	git branch --set-upstream-to master from-master2 &&
+	git branch from-main2 master &&
+	test_must_fail git config branch.from-main2.merge > actual &&
+	git rev-list from-main2 &&
+	git update-ref refs/heads/from-main2 from-main2^ &&
+	git rev-parse from-main2 >expect2 &&
+	git branch --set-upstream-to master from-main2 &&
 	git config branch.from-master.merge > actual &&
-	git rev-parse from-master2 >actual2 &&
+	git rev-parse from-main2 >actual2 &&
 	grep -q "^refs/heads/master$" actual &&
 	cmp expect2 actual2
 '
 
 test_expect_success '--set-upstream-to @{-1}' '
 	git checkout follower &&
-	git checkout from-master2 &&
-	git config branch.from-master2.merge > expect2 &&
+	git checkout from-main2 &&
+	git config branch.from-main2.merge > expect2 &&
 	git branch --set-upstream-to @{-1} from-master &&
 	git config branch.from-master.merge > actual &&
-	git config branch.from-master2.merge > actual2 &&
+	git config branch.from-main2.merge > actual2 &&
 	git branch --set-upstream-to follower from-master &&
 	git config branch.from-master.merge > expect &&
 	test_cmp expect2 actual2 &&
diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh
index 793f0c8bf3..8189c7879e 100755
--- a/t/t6409-merge-subtree.sh
+++ b/t/t6409-merge-subtree.sh
@@ -94,10 +94,10 @@ test_expect_success 'merge update' '
 	echo git-gui2 > git-gui.sh &&
 	o3=$(git hash-object git-gui.sh) &&
 	git add git-gui.sh &&
-	git checkout -b master2 &&
+	git checkout -b main2 &&
 	git commit -m "update git-gui" &&
 	cd ../git &&
-	git pull -s subtree gui master2 &&
+	git pull -s subtree gui main2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o3 0	git-gui/git-gui.sh" &&
@@ -109,7 +109,7 @@ test_expect_success 'merge update' '
 test_expect_success 'initial ambiguous subtree' '
 	cd ../git &&
 	git reset --hard master &&
-	git checkout -b master2 &&
+	git checkout -b main2 &&
 	git merge -s ours --no-commit gui/master &&
 	git read-tree --prefix=git-gui2/ -u gui/master &&
 	git commit -m "Merge git-gui2 as our subdirectory" &&
@@ -125,8 +125,8 @@ test_expect_success 'initial ambiguous subtree' '
 
 test_expect_success 'merge using explicit' '
 	cd ../git &&
-	git reset --hard master2 &&
-	git pull -Xsubtree=git-gui gui master2 &&
+	git reset --hard main2 &&
+	git pull -Xsubtree=git-gui gui main2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o3 0	git-gui/git-gui.sh" &&
@@ -138,8 +138,8 @@ test_expect_success 'merge using explicit' '
 
 test_expect_success 'merge2 using explicit' '
 	cd ../git &&
-	git reset --hard master2 &&
-	git pull -Xsubtree=git-gui2 gui master2 &&
+	git reset --hard main2 &&
+	git pull -Xsubtree=git-gui2 gui main2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	git-gui/git-gui.sh" &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v2 5/5] t9902: avoid using the branch name `master`
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
                     ` (3 preceding siblings ...)
  2020-09-21 22:01   ` [PATCH v2 4/5] tests: " Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:01   ` Johannes Schindelin via GitGitGadget
  2020-09-21 22:35     ` Junio C Hamano
  2020-09-21 22:24   ` [PATCH v2 0/5] Inclusive naming, part II Jeff King
  2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
  6 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-21 22:01 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

The completion tests used that name unnecessarily, and it is a
non-inclusive term, so let's avoid using it here.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9902-completion.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 8425b9a531..7b7bc6e4bd 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -542,37 +542,37 @@ test_expect_success '__gitcomp - doesnt fail because of invalid variable name' '
 '
 
 read -r -d "" refs <<-\EOF
+main
 maint
-master
 next
 seen
 EOF
 
 test_expect_success '__gitcomp_nl - trailing space' '
 	test_gitcomp_nl "m" "$refs" <<-EOF
+	main Z
 	maint Z
-	master Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - prefix' '
 	test_gitcomp_nl "--fixup=m" "$refs" "--fixup=" "m" <<-EOF
+	--fixup=main Z
 	--fixup=maint Z
-	--fixup=master Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - suffix' '
 	test_gitcomp_nl "branch.ma" "$refs" "branch." "ma" "." <<-\EOF
+	branch.main.Z
 	branch.maint.Z
-	branch.master.Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - no suffix' '
 	test_gitcomp_nl "ma" "$refs" "" "ma" "" <<-\EOF
+	mainZ
 	maintZ
-	masterZ
 	EOF
 '
 
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 0/5] Inclusive naming, part II
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
                     ` (4 preceding siblings ...)
  2020-09-21 22:01   ` [PATCH v2 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:24   ` Jeff King
  2020-09-26  4:29     ` Johannes Schindelin
  2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
  6 siblings, 1 reply; 38+ messages in thread
From: Jeff King @ 2020-09-21 22:24 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

On Mon, Sep 21, 2020 at 10:01:21PM +0000, Johannes Schindelin via GitGitGadget wrote:

> Changes since v1:
> 
>  * Instead of using the name primary for the adjustments to 
>    t/test-terminal.perl, we follow Python's lead (which uses the
>    parent/child nomenclature).
>  * The changes to t3200 no longer use variations of the name main as branch
>    names; Instead, the renamed branches are independent from any current or
>    future default branch name.

Thanks, I think that does look nicer. Shouldn't the latter bullet apply
to most of the ones in patch 4, though?

I wonder if they should simply be "s/master/topic/" instead of
"s/master/main".

-Peff

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 4/5] tests: avoid variations of the `master` branch name
  2020-09-21 22:01   ` [PATCH v2 4/5] tests: " Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:31     ` Junio C Hamano
  2020-09-26  4:20       ` Johannes Schindelin
  0 siblings, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2020-09-21 22:31 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Jeff King, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
> index 79e43a370b..ba27e9d603 100755
> --- a/t/t3427-rebase-subtree.sh
> +++ b/t/t3427-rebase-subtree.sh
> @@ -15,12 +15,12 @@ commit_message() {
>  # this test script tries to document them.  First, the following commit history
>  # is generated (the onelines are shown, time flows from left to right):
>  #
> -# master1 - master2 - master3
> +# main1 - main2 - main3

The improvement between v1 and v2 made to t3200 (the previous step)
would equally apply here, no?  IOW, master1 didn't have to have a
name derived from master but could just have been called topic-1.
So replacing master[0-9] with topoic[0-9] may be more appropriate
here.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 5/5] t9902: avoid using the branch name `master`
  2020-09-21 22:01   ` [PATCH v2 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
@ 2020-09-21 22:35     ` Junio C Hamano
  2020-09-26  4:25       ` Johannes Schindelin
  0 siblings, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2020-09-21 22:35 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Jeff King, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> The completion tests used that name unnecessarily, and it is a
> non-inclusive term, so let's avoid using it here.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  t/t9902-completion.sh | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Here, the tests and the tested feature do not work any differently
on the first-made branch, so the same "just use topic, not the
first-made branch name" used in 3/5 applies here.

Luckily, unlike 3/5 and 4/5, this step does not involve names
derived from the name of the first-made branch name, so 'main'
may be OK as-is, but for consistency across the patches, we may
want to consider using 'topic' here as well.  I dunno.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 4/5] tests: avoid variations of the `master` branch name
  2020-09-21 22:31     ` Junio C Hamano
@ 2020-09-26  4:20       ` Johannes Schindelin
  0 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin @ 2020-09-26  4:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git, Jeff King

Hi Junio,

On Mon, 21 Sep 2020, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
> > index 79e43a370b..ba27e9d603 100755
> > --- a/t/t3427-rebase-subtree.sh
> > +++ b/t/t3427-rebase-subtree.sh
> > @@ -15,12 +15,12 @@ commit_message() {
> >  # this test script tries to document them.  First, the following commit history
> >  # is generated (the onelines are shown, time flows from left to right):
> >  #
> > -# master1 - master2 - master3
> > +# main1 - main2 - main3
>
> The improvement between v1 and v2 made to t3200 (the previous step)
> would equally apply here, no?  IOW, master1 didn't have to have a
> name derived from master but could just have been called topic-1.
> So replacing master[0-9] with topoic[0-9] may be more appropriate
> here.

Indeed. It also has the benefit that `topic-` has exactly the same amount
of letters as `master`, therefore we need not worry about any ASCII art
that is modified (and might need realigning).

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 5/5] t9902: avoid using the branch name `master`
  2020-09-21 22:35     ` Junio C Hamano
@ 2020-09-26  4:25       ` Johannes Schindelin
  0 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin @ 2020-09-26  4:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git, Jeff King

Hi Junio,

On Mon, 21 Sep 2020, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > The completion tests used that name unnecessarily, and it is a
> > non-inclusive term, so let's avoid using it here.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >  t/t9902-completion.sh | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
>
> Here, the tests and the tested feature do not work any differently
> on the first-made branch, so the same "just use topic, not the
> first-made branch name" used in 3/5 applies here.
>
> Luckily, unlike 3/5 and 4/5, this step does not involve names
> derived from the name of the first-made branch name, so 'main'
> may be OK as-is, but for consistency across the patches, we may
> want to consider using 'topic' here as well.  I dunno.

I am afraid that three test cases that are touched by this test rely on
the fact that the first two letters (or just the first letter) are
ambiguous when tab-completing branch names: `ma` could complete to either
`master` or `maint`.

To clarify, I added a paragraph to the commit message.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 0/5] Inclusive naming, part II
  2020-09-21 22:24   ` [PATCH v2 0/5] Inclusive naming, part II Jeff King
@ 2020-09-26  4:29     ` Johannes Schindelin
  2020-09-27  8:45       ` Jeff King
  0 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin @ 2020-09-26  4:29 UTC (permalink / raw)
  To: Jeff King; +Cc: Johannes Schindelin via GitGitGadget, git

Hi Peff,

On Mon, 21 Sep 2020, Jeff King wrote:

> On Mon, Sep 21, 2020 at 10:01:21PM +0000, Johannes Schindelin via GitGitGadget wrote:
>
> > Changes since v1:
> >
> >  * Instead of using the name primary for the adjustments to
> >    t/test-terminal.perl, we follow Python's lead (which uses the
> >    parent/child nomenclature).
> >  * The changes to t3200 no longer use variations of the name main as branch
> >    names; Instead, the renamed branches are independent from any current or
> >    future default branch name.
>
> Thanks, I think that does look nicer. Shouldn't the latter bullet apply
> to most of the ones in patch 4, though?
>
> I wonder if they should simply be "s/master/topic/" instead of
> "s/master/main".

Yes! I did that in 4/5. In 5/5, we need a branch name that starts with the
same two letters as `maint`, though. I amended the commit message
accordingly.

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v3 0/5] Inclusive naming, part II
  2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
                     ` (5 preceding siblings ...)
  2020-09-21 22:24   ` [PATCH v2 0/5] Inclusive naming, part II Jeff King
@ 2020-09-26 21:04   ` Johannes Schindelin via GitGitGadget
  2020-09-26 21:04     ` [PATCH v3 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
                       ` (5 more replies)
  6 siblings, 6 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-26 21:04 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Johannes Schindelin, Johannes Schindelin

This patch series represents the logical next step on the journey begun with
introducing init.defaultBranch: in these patches, we avoid a couple
unnecessary mentions of the branch name "master".

This patch series does not try to change the default branch name, although I
have that patch series ready to go. You can see the overall idea here: 
https://github.com/gitgitgadget/git/pull/655. Concretely, I plan on
submitting three more patch series after this one:

 1. a relatively small patch series to avoid using the branch name main in
    the test suite. This is necessary because my plan is to change the
    default branch name to that name, therefore it cannot be used as the
    name of a topic branch any longer.
 2. a relatively large patch series (currently consisting of 18 patches) to
    change the default branch name to main. Most of the patches provide
    non-trivial (read: non-scriptable) adjustments to the test suite in an
    incremental fashion, with a big patch toward the end that reflects a
    fully-automated search-and-replace of all the trivial cases.
 3. a very small patch series with fall-out patches that are not necessary
    to pass the test suite, but are still required to complete the rename
    (adjusted code comment, file rename).

(Note: I am still debating whether I should move one or two patches from the
second to the third patch series)

Changes since v2:

 * Extended the idea of using topic instead of main to patch 4/5.
 * Explained in the commit message of patch 5/5 why we cannot use topic 
   instead of main here.

Changes since v1:

 * Instead of using the name primary for the adjustments to 
   t/test-terminal.perl, we follow Python's lead (which uses the
   parent/child nomenclature).
 * The changes to t3200 no longer use variations of the name main as branch
   names; Instead, the renamed branches are independent from any current or
   future default branch name.

Johannes Schindelin (5):
  fast-export: avoid using unnecessary language in a code comment
  t/test-terminal: avoid non-inclusive language
  t3200: avoid variations of the `master` branch name
  tests: avoid variations of the `master` branch name
  t9902: avoid using the branch name `master`

 builtin/fast-export.c        |  2 +-
 t/t3200-branch.sh            | 34 ++++++++++++++---------------
 t/t3427-rebase-subtree.sh    | 42 ++++++++++++++++++------------------
 t/t4150-am.sh                |  8 +++----
 t/t5515-fetch-merge-logic.sh |  6 +++---
 t/t5523-push-upstream.sh     | 20 ++++++++---------
 t/t6018-rev-list-glob.sh     |  6 +++---
 t/t6040-tracking-info.sh     | 20 ++++++++---------
 t/t6409-merge-subtree.sh     | 14 ++++++------
 t/t9902-completion.sh        | 10 ++++-----
 t/test-terminal.perl         | 32 +++++++++++++--------------
 11 files changed, 97 insertions(+), 97 deletions(-)


base-commit: 54e85e7af1ac9e9a92888060d6811ae767fea1bc
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-734%2Fdscho%2Favoid-unnecessary-branch-name-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-734/dscho/avoid-unnecessary-branch-name-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/734

Range-diff vs v2:

 1:  587ddca42a = 1:  587ddca42a fast-export: avoid using unnecessary language in a code comment
 2:  80e1d46cce = 2:  80e1d46cce t/test-terminal: avoid non-inclusive language
 3:  8d8e9abfe2 = 3:  8d8e9abfe2 t3200: avoid variations of the `master` branch name
 4:  8f59e19b95 ! 4:  ef8a9b74ed tests: avoid variations of the `master` branch name
     @@ Commit message
          because they do not require any changes outside of the test script, so
          let's do that.
      
     -    Seeing as `main` seems to be materializing as the favorite default
     -    branch name of many Open Source projects, we use that name in our
     -    replacements, too.
     +    Seeing as the touched branches have very little (if anything) to do with
     +    the default branch, we choose to use a completely separate naming
     +    scheme: `topic_<number>` (it cannot be `topic-<number>` because t5515
     +    uses the `test_oid` machinery with the term, and that machinery uses
     +    shell variables internally, whose names cannot contain dashes).
      
          This trick was performed by this (GNU) sed invocation:
      
     -            $ sed -i 's/master\([a-z0-9]\)/main\1/g' t/t*.sh
     +            $ sed -i 's/master\([a-z0-9]\)/topic_\1/g' t/t*.sh
      
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
     @@ t/t3427-rebase-subtree.sh: commit_message() {
       # is generated (the onelines are shown, time flows from left to right):
       #
      -# master1 - master2 - master3
     -+# main1 - main2 - main3
     ++# topic_1 - topic_2 - topic_3
       #                             \
      -# README ---------------------- Add subproject master - master4 - files_subtree/master5
     -+# README ---------------------- Add subproject master - main4 - files_subtree/main5
     ++# README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5
       #
       # Where the merge moves the files master[123].t into the subdirectory
      -# files_subtree/ and master4 as well as files_subtree/master5 add files to that
     -+# files_subtree/ and main4 as well as files_subtree/main5 add files to that
     ++# files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
       # directory directly.
       #
       # Then, in subsequent test cases, `git filter-branch` is used to distill just
     @@ t/t3427-rebase-subtree.sh: commit_message() {
       # this:
       #
      -# Add subproject master - master4 - files_subtree/master5 - Empty commit
     -+# Add subproject master - main4 - files_subtree/main5 - Empty commit
     ++# Add subproject master - topic_4 - files_subtree/topic_5 - Empty commit
       #
      -# where the root commit adds three files: master1.t, master2.t and master3.t.
     -+# where the root commit adds three files: main1.t, main2.t and main3.t.
     ++# where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t.
       #
      -# This commit history is then rebased onto `master3` with the
     -+# This commit history is then rebased onto `main3` with the
     ++# This commit history is then rebased onto `topic_3` with the
       # `-Xsubtree=files_subtree` option in three different ways:
       #
       # 1. using `--preserve-merges`
     @@ t/t3427-rebase-subtree.sh: test_expect_success 'setup' '
      -	test_commit -C files master1 &&
      -	test_commit -C files master2 &&
      -	test_commit -C files master3 &&
     -+	test_commit -C files main1 &&
     -+	test_commit -C files main2 &&
     -+	test_commit -C files main3 &&
     ++	test_commit -C files topic_1 &&
     ++	test_commit -C files topic_2 &&
     ++	test_commit -C files topic_3 &&
       
       	: perform subtree merge into files_subtree/ &&
       	git fetch files refs/heads/master:refs/heads/files-master &&
     @@ t/t3427-rebase-subtree.sh: test_expect_success 'setup' '
       	: add two extra commits to rebase &&
      -	test_commit -C files_subtree master4 &&
      -	test_commit files_subtree/master5 &&
     -+	test_commit -C files_subtree main4 &&
     -+	test_commit files_subtree/main5 &&
     ++	test_commit -C files_subtree topic_4 &&
     ++	test_commit files_subtree/topic_5 &&
       
       	git checkout -b to-rebase &&
       	git fast-export --no-data HEAD -- files_subtree/ |
     @@ t/t3427-rebase-subtree.sh: test_expect_success 'setup' '
       '
       
      -# FAILURE: Does not preserve master4.
     -+# FAILURE: Does not preserve main4.
     ++# FAILURE: Does not preserve topic_4.
       test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
       	reset_rebase &&
       	git checkout -b rebase-preserve-merges to-rebase &&
       	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
      -	verbose test "$(commit_message HEAD~)" = "master4" &&
      -	verbose test "$(commit_message HEAD)" = "files_subtree/master5"
     -+	verbose test "$(commit_message HEAD~)" = "main4" &&
     -+	verbose test "$(commit_message HEAD)" = "files_subtree/main5"
     ++	verbose test "$(commit_message HEAD~)" = "topic_4" &&
     ++	verbose test "$(commit_message HEAD)" = "files_subtree/topic_5"
       '
       
      -# FAILURE: Does not preserve master4.
     -+# FAILURE: Does not preserve main4.
     ++# FAILURE: Does not preserve topic_4.
       test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
       	reset_rebase &&
       	git checkout -b rebase-keep-empty to-rebase &&
       	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
      -	verbose test "$(commit_message HEAD~2)" = "master4" &&
      -	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
     -+	verbose test "$(commit_message HEAD~2)" = "main4" &&
     -+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
     ++	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
     ++	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
       	verbose test "$(commit_message HEAD)" = "Empty commit"
       '
       
     @@ t/t3427-rebase-subtree.sh: test_expect_success 'Rebase -Xsubtree --empty=ask --o
       	git rebase --skip &&
      -	verbose test "$(commit_message HEAD~2)" = "master4" &&
      -	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
     -+	verbose test "$(commit_message HEAD~2)" = "main4" &&
     -+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
     ++	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
     ++	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
       	verbose test "$(commit_message HEAD)" = "Empty commit"
       '
       
     @@ t/t3427-rebase-subtree.sh: test_expect_success 'Rebase -Xsubtree --empty=ask --r
       	git rebase --skip &&
      -	verbose test "$(commit_message HEAD~2)" = "master4" &&
      -	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
     -+	verbose test "$(commit_message HEAD~2)" = "main4" &&
     -+	verbose test "$(commit_message HEAD~)" = "files_subtree/main5" &&
     ++	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
     ++	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
       	verbose test "$(commit_message HEAD)" = "Empty commit"
       '
       
     @@ t/t4150-am.sh: test_expect_success 'am changes committer and keeps author' '
       	rm -fr .git/rebase-apply &&
       	git reset --hard &&
      -	git checkout -b master2 first &&
     -+	git checkout -b main2 first &&
     ++	git checkout -b topic_2 first &&
       	git am --signoff <patch2 &&
       	{
       		printf "third\n\nSigned-off-by: %s <%s>\n\n" \
     @@ t/t4150-am.sh: test_expect_success 'am --signoff adds Signed-off-by: line' '
       
       test_expect_success 'am stays in branch' '
      -	echo refs/heads/master2 >expected &&
     -+	echo refs/heads/main2 >expected &&
     ++	echo refs/heads/topic_2 >expected &&
       	git symbolic-ref HEAD >actual &&
       	test_cmp expected actual
       '
     @@ t/t4150-am.sh: test_expect_success 'am without --keep removes Re: and [PATCH] st
       	git am <patch4 &&
       	git rev-parse HEAD >expected &&
      -	git rev-parse master2 >actual &&
     -+	git rev-parse main2 >actual &&
     ++	git rev-parse topic_2 >actual &&
       	test_cmp expected actual
       '
       
     @@ t/t4150-am.sh: test_expect_success 'am --keep-non-patch really keeps the non-pat
       	rm -fr .git/rebase-apply &&
       	git reset --hard &&
      -	git checkout -b base3way master2 &&
     -+	git checkout -b base3way main2 &&
     ++	git checkout -b base3way topic_2 &&
       	sed -n -e "3,\$p" msg >file &&
       	head -n 9 msg >>file &&
       	git add file &&
     @@ t/t5515-fetch-merge-logic.sh: export GIT_TEST_PROTOCOL_VERSION
       build_script () {
       	script="$1" &&
      -	for i in one three_file master master2 one_tree three two two2 three2
     -+	for i in one three_file master main2 one_tree three two two2 three2
     ++	for i in one three_file master topic_2 one_tree three two two2 three2
       	do
       		echo "s/$(test_oid --hash=sha1 "$i")/$(test_oid "$i")/g" >>"$script"
       	done
     @@ t/t5515-fetch-merge-logic.sh: test_expect_success setup '
       
      -	master2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
      -	master2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
     -+	main2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
     -+	main2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
     ++	topic_2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
     ++	topic_2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
       
       	two2 sha1:6134ee8f857693b96ff1cc98d3e2fd62b199e5a8
       	two2 sha256:87a2d3ee29c83a3dc7afd41c0606b11f67603120b910a7be7840accdc18344d4
     @@ t/t5523-push-upstream.sh: test_expect_success 'push -u --dry-run master:otherX'
      -	git branch master2 &&
      -	git push -u upstream master2:master2 &&
      -	check_config master2 upstream refs/heads/master2
     -+test_expect_success 'push -u main2:main2' '
     -+	git branch main2 &&
     -+	git push -u upstream main2:main2 &&
     -+	check_config main2 upstream refs/heads/main2
     ++test_expect_success 'push -u topic_2:topic_2' '
     ++	git branch topic_2 &&
     ++	git push -u upstream topic_2:topic_2 &&
     ++	check_config topic_2 upstream refs/heads/topic_2
       '
       
      -test_expect_success 'push -u master2:other2' '
      -	git push -u upstream master2:other2 &&
      -	check_config master2 upstream refs/heads/other2
     -+test_expect_success 'push -u main2:other2' '
     -+	git push -u upstream main2:other2 &&
     -+	check_config main2 upstream refs/heads/other2
     ++test_expect_success 'push -u topic_2:other2' '
     ++	git push -u upstream topic_2:other2 &&
     ++	check_config topic_2 upstream refs/heads/other2
       '
       
      -test_expect_success 'push -u :master2' '
      -	git push -u upstream :master2 &&
      -	check_config master2 upstream refs/heads/other2
     -+test_expect_success 'push -u :main2' '
     -+	git push -u upstream :main2 &&
     -+	check_config main2 upstream refs/heads/other2
     ++test_expect_success 'push -u :topic_2' '
     ++	git push -u upstream :topic_2 &&
     ++	check_config topic_2 upstream refs/heads/other2
       '
       
       test_expect_success 'push -u --all' '
     @@ t/t6018-rev-list-glob.sh: test_expect_success 'setup' '
       	commit some &&
       	git checkout master &&
      -	commit master2 &&
     -+	commit main2 &&
     ++	commit topic_2 &&
       	git tag foo/bar master &&
      -	commit master3 &&
     -+	commit main3 &&
     ++	commit topic_3 &&
       	git update-ref refs/remotes/foo/baz master &&
      -	commit master4 &&
     -+	commit main4 &&
     ++	commit topic_4 &&
       	git update-ref refs/remotes/upstream/one subspace/one &&
       	git update-ref refs/remotes/upstream/two subspace/two &&
       	git update-ref refs/remotes/upstream/x subspace-x &&
     @@ t/t6040-tracking-info.sh: test_expect_success 'fail to track annotated tags' '
      -	git update-ref refs/heads/from-master2 from-master2^ &&
      -	git rev-parse from-master2 >expect2 &&
      -	git branch --set-upstream-to master from-master2 &&
     -+	git branch from-main2 master &&
     -+	test_must_fail git config branch.from-main2.merge > actual &&
     -+	git rev-list from-main2 &&
     -+	git update-ref refs/heads/from-main2 from-main2^ &&
     -+	git rev-parse from-main2 >expect2 &&
     -+	git branch --set-upstream-to master from-main2 &&
     ++	git branch from-topic_2 master &&
     ++	test_must_fail git config branch.from-topic_2.merge > actual &&
     ++	git rev-list from-topic_2 &&
     ++	git update-ref refs/heads/from-topic_2 from-topic_2^ &&
     ++	git rev-parse from-topic_2 >expect2 &&
     ++	git branch --set-upstream-to master from-topic_2 &&
       	git config branch.from-master.merge > actual &&
      -	git rev-parse from-master2 >actual2 &&
     -+	git rev-parse from-main2 >actual2 &&
     ++	git rev-parse from-topic_2 >actual2 &&
       	grep -q "^refs/heads/master$" actual &&
       	cmp expect2 actual2
       '
     @@ t/t6040-tracking-info.sh: test_expect_success 'fail to track annotated tags' '
       	git checkout follower &&
      -	git checkout from-master2 &&
      -	git config branch.from-master2.merge > expect2 &&
     -+	git checkout from-main2 &&
     -+	git config branch.from-main2.merge > expect2 &&
     ++	git checkout from-topic_2 &&
     ++	git config branch.from-topic_2.merge > expect2 &&
       	git branch --set-upstream-to @{-1} from-master &&
       	git config branch.from-master.merge > actual &&
      -	git config branch.from-master2.merge > actual2 &&
     -+	git config branch.from-main2.merge > actual2 &&
     ++	git config branch.from-topic_2.merge > actual2 &&
       	git branch --set-upstream-to follower from-master &&
       	git config branch.from-master.merge > expect &&
       	test_cmp expect2 actual2 &&
     @@ t/t6409-merge-subtree.sh: test_expect_success 'merge update' '
       	o3=$(git hash-object git-gui.sh) &&
       	git add git-gui.sh &&
      -	git checkout -b master2 &&
     -+	git checkout -b main2 &&
     ++	git checkout -b topic_2 &&
       	git commit -m "update git-gui" &&
       	cd ../git &&
      -	git pull -s subtree gui master2 &&
     -+	git pull -s subtree gui main2 &&
     ++	git pull -s subtree gui topic_2 &&
       	git ls-files -s >actual &&
       	(
       		echo "100644 $o3 0	git-gui/git-gui.sh" &&
     @@ t/t6409-merge-subtree.sh: test_expect_success 'merge update' '
       	cd ../git &&
       	git reset --hard master &&
      -	git checkout -b master2 &&
     -+	git checkout -b main2 &&
     ++	git checkout -b topic_2 &&
       	git merge -s ours --no-commit gui/master &&
       	git read-tree --prefix=git-gui2/ -u gui/master &&
       	git commit -m "Merge git-gui2 as our subdirectory" &&
     @@ t/t6409-merge-subtree.sh: test_expect_success 'initial ambiguous subtree' '
       	cd ../git &&
      -	git reset --hard master2 &&
      -	git pull -Xsubtree=git-gui gui master2 &&
     -+	git reset --hard main2 &&
     -+	git pull -Xsubtree=git-gui gui main2 &&
     ++	git reset --hard topic_2 &&
     ++	git pull -Xsubtree=git-gui gui topic_2 &&
       	git ls-files -s >actual &&
       	(
       		echo "100644 $o3 0	git-gui/git-gui.sh" &&
     @@ t/t6409-merge-subtree.sh: test_expect_success 'merge using explicit' '
       	cd ../git &&
      -	git reset --hard master2 &&
      -	git pull -Xsubtree=git-gui2 gui master2 &&
     -+	git reset --hard main2 &&
     -+	git pull -Xsubtree=git-gui2 gui main2 &&
     ++	git reset --hard topic_2 &&
     ++	git pull -Xsubtree=git-gui2 gui topic_2 &&
       	git ls-files -s >actual &&
       	(
       		echo "100644 $o1 0	git-gui/git-gui.sh" &&
 5:  c2c1238b5d ! 5:  a80297f5df t9902: avoid using the branch name `master`
     @@ Commit message
          The completion tests used that name unnecessarily, and it is a
          non-inclusive term, so let's avoid using it here.
      
     +    Since three of the touched test cases make use of the fact that two of
     +    the branch names (`master` and `maint`) start with the same letter (or
     +    even with the same two letters), we choose to replace the use of
     +    `master` by a name that also has that property: `main`.
     +
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t9902-completion.sh ##

-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH v3 1/5] fast-export: avoid using unnecessary language in a code comment
  2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
@ 2020-09-26 21:04     ` Johannes Schindelin via GitGitGadget
  2020-09-26 21:04     ` [PATCH v3 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-26 21:04 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In an ongoing effort to avoid non-inclusive language, let's avoid using
the branch name "master" in a code comment.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 builtin/fast-export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 1b8fca3ee0..5527135ba8 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -1026,7 +1026,7 @@ static void handle_tags_and_duplicates(struct string_list *extras)
 				/*
 				 * Getting here means we have a commit which
 				 * was excluded by a negative refspec (e.g.
-				 * fast-export ^master master).  If we are
+				 * fast-export ^HEAD HEAD).  If we are
 				 * referencing excluded commits, set the ref
 				 * to the exact commit.  Otherwise, the user
 				 * wants the branch exported but every commit
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 2/5] t/test-terminal: avoid non-inclusive language
  2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
  2020-09-26 21:04     ` [PATCH v3 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
@ 2020-09-26 21:04     ` Johannes Schindelin via GitGitGadget
  2020-09-26 21:04     ` [PATCH v3 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
                       ` (3 subsequent siblings)
  5 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-26 21:04 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In the ongoing effort to make the Git project a more inclusive place,
let's try to avoid names like "master" where possible.

In this instance, the use of the term `slave` is unfortunately enshrined
in IO::Pty's API. We simply cannot avoid using that word here. But at
least we can get rid of the usage of the word `master` and hope that
IO::Pty will be eventually adjusted, too.

Guessing that IO::Pty might follow Python's lead, we replace the name
`master` by `parent` (hoping that IO::Pty will adopt the parent/child
nomenclature, too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/test-terminal.perl | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/t/test-terminal.perl b/t/test-terminal.perl
index 46bf618479..1bcf01a9a4 100755
--- a/t/test-terminal.perl
+++ b/t/test-terminal.perl
@@ -81,24 +81,24 @@ sub copy_stdio {
 	die "usage: test-terminal program args";
 }
 $ENV{TERM} = 'vt100';
-my $master_in = new IO::Pty;
-my $master_out = new IO::Pty;
-my $master_err = new IO::Pty;
-$master_in->set_raw();
-$master_out->set_raw();
-$master_err->set_raw();
-$master_in->slave->set_raw();
-$master_out->slave->set_raw();
-$master_err->slave->set_raw();
-my $pid = start_child(\@ARGV, $master_in->slave, $master_out->slave, $master_err->slave);
-close $master_in->slave;
-close $master_out->slave;
-close $master_err->slave;
-my $in_pid = copy_stdin($master_in);
-copy_stdio($master_out, $master_err);
+my $parent_in = new IO::Pty;
+my $parent_out = new IO::Pty;
+my $parent_err = new IO::Pty;
+$parent_in->set_raw();
+$parent_out->set_raw();
+$parent_err->set_raw();
+$parent_in->slave->set_raw();
+$parent_out->slave->set_raw();
+$parent_err->slave->set_raw();
+my $pid = start_child(\@ARGV, $parent_in->slave, $parent_out->slave, $parent_err->slave);
+close $parent_in->slave;
+close $parent_out->slave;
+close $parent_err->slave;
+my $in_pid = copy_stdin($parent_in);
+copy_stdio($parent_out, $parent_err);
 my $ret = finish_child($pid);
 # If the child process terminates before our copy_stdin() process is able to
-# write all of its data to $master_in, the copy_stdin() process could stall.
+# write all of its data to $parent_in, the copy_stdin() process could stall.
 # Send SIGTERM to it to ensure it terminates.
 kill 'TERM', $in_pid;
 finish_child($in_pid);
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 3/5] t3200: avoid variations of the `master` branch name
  2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
  2020-09-26 21:04     ` [PATCH v3 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
  2020-09-26 21:04     ` [PATCH v3 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
@ 2020-09-26 21:04     ` Johannes Schindelin via GitGitGadget
  2020-09-26 21:04     ` [PATCH v3 4/5] tests: " Johannes Schindelin via GitGitGadget
                       ` (2 subsequent siblings)
  5 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-26 21:04 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

To avoid branch names with a loaded history, we already started to avoid
using the name "master" in a couple instances.

The `t3200-branch.sh` script uses variations of this name for branches
other than the default one. So let's change those names, as
"lowest-hanging fruits" in the effort to use more inclusive naming
throughout Git's source code. While at it, make those branch names
independent from the default branch name.

In this particular instance, this rename requires a couple of
non-trivial adjustments, as the aligned output depends on the maximum
length of the displayed branches (which we now changed), and also on the
alphabetical order (which we now changed, too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3200-branch.sh | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 4c0734157b..cc27e3bfdb 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -234,10 +234,10 @@ test_expect_success 'git branch -M master master should work when master is chec
 	git branch -M master master
 '
 
-test_expect_success 'git branch -M master2 master2 should work when master is checked out' '
+test_expect_success 'git branch -M topic topic should work when master is checked out' '
 	git checkout master &&
-	git branch master2 &&
-	git branch -M master2 master2
+	git branch topic &&
+	git branch -M topic topic
 '
 
 test_expect_success 'git branch -v -d t should work' '
@@ -324,8 +324,8 @@ test_expect_success 'git branch --list -v with --abbrev' '
 test_expect_success 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expect <<\EOF &&
-  a/b/c     bam       foo       l       * master    mb        o/o       q
-  abc       bar       j/k       m/m       master2   n         o/p       r
+  a/b/c    bam      foo      l      * master   n        o/p      r
+  abc      bar      j/k      m/m      mb       o/o      q        topic
 EOF
 	test_cmp expect actual
 '
@@ -346,13 +346,13 @@ test_expect_success 'git branch --column with an extremely long branch name' '
   l
   m/m
 * master
-  master2
   mb
   n
   o/o
   o/p
   q
   r
+  topic
   $long
 EOF
 	test_cmp expect actual
@@ -365,8 +365,8 @@ test_expect_success 'git branch with column.*' '
 	git config --unset column.branch &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
-  a/b/c   bam   foo   l   * master    mb   o/o   q
-  abc     bar   j/k   m/m   master2   n    o/p   r
+  a/b/c   bam   foo   l   * master   n     o/p   r
+  abc     bar   j/k   m/m   mb       o/o   q     topic
 EOF
 	test_cmp expect actual
 '
@@ -377,7 +377,7 @@ test_expect_success 'git branch --column -v should fail' '
 
 test_expect_success 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
-	COLUMNS=80 git branch -v | cut -c -10 | sed "s/ *$//" >actual &&
+	COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
 	cat >expect <<\EOF &&
   a/b/c
@@ -389,13 +389,13 @@ test_expect_success 'git branch -v with column.ui ignored' '
   l
   m/m
 * master
-  master2
   mb
   n
   o/o
   o/p
   q
   r
+  topic
 EOF
 	test_cmp expect actual
 '
@@ -597,10 +597,10 @@ test_expect_success 'git branch -C master master should work when master is chec
 	git branch -C master master
 '
 
-test_expect_success 'git branch -C master5 master5 should work when master is checked out' '
+test_expect_success 'git branch -C main5 main5 should work when master is checked out' '
 	git checkout master &&
-	git branch master5 &&
-	git branch -C master5 master5
+	git branch main5 &&
+	git branch -C main5 main5
 '
 
 test_expect_success 'git branch -C ab cd should overwrite existing config for cd' '
@@ -711,11 +711,11 @@ test_expect_success 'deleting a self-referential symref' '
 '
 
 test_expect_success 'renaming a symref is not allowed' '
-	git symbolic-ref refs/heads/master2 refs/heads/master &&
-	test_must_fail git branch -m master2 master3 &&
-	git symbolic-ref refs/heads/master2 &&
+	git symbolic-ref refs/heads/topic refs/heads/master &&
+	test_must_fail git branch -m topic new-topic &&
+	git symbolic-ref refs/heads/topic &&
 	test_path_is_file .git/refs/heads/master &&
-	test_path_is_missing .git/refs/heads/master3
+	test_path_is_missing .git/refs/heads/new-topic
 '
 
 test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 4/5] tests: avoid variations of the `master` branch name
  2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
                       ` (2 preceding siblings ...)
  2020-09-26 21:04     ` [PATCH v3 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
@ 2020-09-26 21:04     ` Johannes Schindelin via GitGitGadget
  2020-09-26 21:04     ` [PATCH v3 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
  2020-09-30 22:21     ` [PATCH v3 0/5] Inclusive naming, part II Junio C Hamano
  5 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-26 21:04 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

The term `master` has a loaded history that serves as a constant
reminder of racial injustice. The Git project has no desire to
perpetuate this and already started avoiding it.

The test suite uses variations of this name for branches other than the
default one. Apart from t3200, where we just addressed this in the
previous commit, those instances can be renamed in an automated manner
because they do not require any changes outside of the test script, so
let's do that.

Seeing as the touched branches have very little (if anything) to do with
the default branch, we choose to use a completely separate naming
scheme: `topic_<number>` (it cannot be `topic-<number>` because t5515
uses the `test_oid` machinery with the term, and that machinery uses
shell variables internally, whose names cannot contain dashes).

This trick was performed by this (GNU) sed invocation:

	$ sed -i 's/master\([a-z0-9]\)/topic_\1/g' t/t*.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3427-rebase-subtree.sh    | 42 ++++++++++++++++++------------------
 t/t4150-am.sh                |  8 +++----
 t/t5515-fetch-merge-logic.sh |  6 +++---
 t/t5523-push-upstream.sh     | 20 ++++++++---------
 t/t6018-rev-list-glob.sh     |  6 +++---
 t/t6040-tracking-info.sh     | 20 ++++++++---------
 t/t6409-merge-subtree.sh     | 14 ++++++------
 7 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 79e43a370b..2a7d958ea7 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -15,12 +15,12 @@ commit_message() {
 # this test script tries to document them.  First, the following commit history
 # is generated (the onelines are shown, time flows from left to right):
 #
-# master1 - master2 - master3
+# topic_1 - topic_2 - topic_3
 #                             \
-# README ---------------------- Add subproject master - master4 - files_subtree/master5
+# README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5
 #
 # Where the merge moves the files master[123].t into the subdirectory
-# files_subtree/ and master4 as well as files_subtree/master5 add files to that
+# files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
 # directory directly.
 #
 # Then, in subsequent test cases, `git filter-branch` is used to distill just
@@ -28,11 +28,11 @@ commit_message() {
 # an empty commit is added on top. The pre-rebase commit history looks like
 # this:
 #
-# Add subproject master - master4 - files_subtree/master5 - Empty commit
+# Add subproject master - topic_4 - files_subtree/topic_5 - Empty commit
 #
-# where the root commit adds three files: master1.t, master2.t and master3.t.
+# where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t.
 #
-# This commit history is then rebased onto `master3` with the
+# This commit history is then rebased onto `topic_3` with the
 # `-Xsubtree=files_subtree` option in three different ways:
 #
 # 1. using `--preserve-merges`
@@ -43,9 +43,9 @@ test_expect_success 'setup' '
 	test_commit README &&
 
 	git init files &&
-	test_commit -C files master1 &&
-	test_commit -C files master2 &&
-	test_commit -C files master3 &&
+	test_commit -C files topic_1 &&
+	test_commit -C files topic_2 &&
+	test_commit -C files topic_3 &&
 
 	: perform subtree merge into files_subtree/ &&
 	git fetch files refs/heads/master:refs/heads/files-master &&
@@ -55,8 +55,8 @@ test_expect_success 'setup' '
 	git commit -m "Add subproject master" &&
 
 	: add two extra commits to rebase &&
-	test_commit -C files_subtree master4 &&
-	test_commit files_subtree/master5 &&
+	test_commit -C files_subtree topic_4 &&
+	test_commit files_subtree/topic_5 &&
 
 	git checkout -b to-rebase &&
 	git fast-export --no-data HEAD -- files_subtree/ |
@@ -66,22 +66,22 @@ test_expect_success 'setup' '
 	git commit -m "Empty commit" --allow-empty
 '
 
-# FAILURE: Does not preserve master4.
+# FAILURE: Does not preserve topic_4.
 test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-preserve-merges to-rebase &&
 	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
-	verbose test "$(commit_message HEAD~)" = "master4" &&
-	verbose test "$(commit_message HEAD)" = "files_subtree/master5"
+	verbose test "$(commit_message HEAD~)" = "topic_4" &&
+	verbose test "$(commit_message HEAD)" = "files_subtree/topic_5"
 '
 
-# FAILURE: Does not preserve master4.
+# FAILURE: Does not preserve topic_4.
 test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-keep-empty to-rebase &&
 	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
@@ -91,8 +91,8 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-master master &&
 	: first pick results in no changes &&
 	git rebase --skip &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
@@ -102,8 +102,8 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit'
 	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-master --root &&
 	: first pick results in no changes &&
 	git rebase --skip &&
-	verbose test "$(commit_message HEAD~2)" = "master4" &&
-	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
+	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
+	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 1da8ab120b..3ecbef6f8e 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -465,7 +465,7 @@ test_expect_success 'am changes committer and keeps author' '
 test_expect_success 'am --signoff adds Signed-off-by: line' '
 	rm -fr .git/rebase-apply &&
 	git reset --hard &&
-	git checkout -b master2 first &&
+	git checkout -b topic_2 first &&
 	git am --signoff <patch2 &&
 	{
 		printf "third\n\nSigned-off-by: %s <%s>\n\n" \
@@ -479,7 +479,7 @@ test_expect_success 'am --signoff adds Signed-off-by: line' '
 '
 
 test_expect_success 'am stays in branch' '
-	echo refs/heads/master2 >expected &&
+	echo refs/heads/topic_2 >expected &&
 	git symbolic-ref HEAD >actual &&
 	test_cmp expected actual
 '
@@ -540,7 +540,7 @@ test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '
 	git reset --hard HEAD^ &&
 	git am <patch4 &&
 	git rev-parse HEAD >expected &&
-	git rev-parse master2 >actual &&
+	git rev-parse topic_2 >actual &&
 	test_cmp expected actual
 '
 
@@ -567,7 +567,7 @@ test_expect_success 'am --keep-non-patch really keeps the non-patch part' '
 test_expect_success 'setup am -3' '
 	rm -fr .git/rebase-apply &&
 	git reset --hard &&
-	git checkout -b base3way master2 &&
+	git checkout -b base3way topic_2 &&
 	sed -n -e "3,\$p" msg >file &&
 	head -n 9 msg >>file &&
 	git add file &&
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 9d6a46ff56..70a9d2d8ab 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -15,7 +15,7 @@ export GIT_TEST_PROTOCOL_VERSION
 
 build_script () {
 	script="$1" &&
-	for i in one three_file master master2 one_tree three two two2 three2
+	for i in one three_file master topic_2 one_tree three two two2 three2
 	do
 		echo "s/$(test_oid --hash=sha1 "$i")/$(test_oid "$i")/g" >>"$script"
 	done
@@ -52,8 +52,8 @@ test_expect_success setup '
 	two sha1:525b7fb068d59950d185a8779dc957c77eed73ba
 	two sha256:3b21de3440cd38c2a9e9b464adb923f7054949ed4c918e1a0ac4c95cd52774db
 
-	master2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
-	master2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
+	topic_2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
+	topic_2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
 
 	two2 sha1:6134ee8f857693b96ff1cc98d3e2fd62b199e5a8
 	two2 sha256:87a2d3ee29c83a3dc7afd41c0606b11f67603120b910a7be7840accdc18344d4
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index c0df81a014..e47b5db5d6 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -41,20 +41,20 @@ test_expect_success 'push -u --dry-run master:otherX' '
 	check_config master upstream refs/heads/other
 '
 
-test_expect_success 'push -u master2:master2' '
-	git branch master2 &&
-	git push -u upstream master2:master2 &&
-	check_config master2 upstream refs/heads/master2
+test_expect_success 'push -u topic_2:topic_2' '
+	git branch topic_2 &&
+	git push -u upstream topic_2:topic_2 &&
+	check_config topic_2 upstream refs/heads/topic_2
 '
 
-test_expect_success 'push -u master2:other2' '
-	git push -u upstream master2:other2 &&
-	check_config master2 upstream refs/heads/other2
+test_expect_success 'push -u topic_2:other2' '
+	git push -u upstream topic_2:other2 &&
+	check_config topic_2 upstream refs/heads/other2
 '
 
-test_expect_success 'push -u :master2' '
-	git push -u upstream :master2 &&
-	check_config master2 upstream refs/heads/other2
+test_expect_success 'push -u :topic_2' '
+	git push -u upstream :topic_2 &&
+	check_config topic_2 upstream refs/heads/other2
 '
 
 test_expect_success 'push -u --all' '
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index b31ff7eeec..fe2f3cec3d 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -32,11 +32,11 @@ test_expect_success 'setup' '
 	git checkout -b someref master &&
 	commit some &&
 	git checkout master &&
-	commit master2 &&
+	commit topic_2 &&
 	git tag foo/bar master &&
-	commit master3 &&
+	commit topic_3 &&
 	git update-ref refs/remotes/foo/baz master &&
-	commit master4 &&
+	commit topic_4 &&
 	git update-ref refs/remotes/upstream/one subspace/one &&
 	git update-ref refs/remotes/upstream/two subspace/two &&
 	git update-ref refs/remotes/upstream/x subspace-x &&
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index ad1922b999..50a934e1b2 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -264,25 +264,25 @@ test_expect_success 'fail to track annotated tags' '
 test_expect_success '--set-upstream-to does not change branch' '
 	git branch from-master master &&
 	git branch --set-upstream-to master from-master &&
-	git branch from-master2 master &&
-	test_must_fail git config branch.from-master2.merge > actual &&
-	git rev-list from-master2 &&
-	git update-ref refs/heads/from-master2 from-master2^ &&
-	git rev-parse from-master2 >expect2 &&
-	git branch --set-upstream-to master from-master2 &&
+	git branch from-topic_2 master &&
+	test_must_fail git config branch.from-topic_2.merge > actual &&
+	git rev-list from-topic_2 &&
+	git update-ref refs/heads/from-topic_2 from-topic_2^ &&
+	git rev-parse from-topic_2 >expect2 &&
+	git branch --set-upstream-to master from-topic_2 &&
 	git config branch.from-master.merge > actual &&
-	git rev-parse from-master2 >actual2 &&
+	git rev-parse from-topic_2 >actual2 &&
 	grep -q "^refs/heads/master$" actual &&
 	cmp expect2 actual2
 '
 
 test_expect_success '--set-upstream-to @{-1}' '
 	git checkout follower &&
-	git checkout from-master2 &&
-	git config branch.from-master2.merge > expect2 &&
+	git checkout from-topic_2 &&
+	git config branch.from-topic_2.merge > expect2 &&
 	git branch --set-upstream-to @{-1} from-master &&
 	git config branch.from-master.merge > actual &&
-	git config branch.from-master2.merge > actual2 &&
+	git config branch.from-topic_2.merge > actual2 &&
 	git branch --set-upstream-to follower from-master &&
 	git config branch.from-master.merge > expect &&
 	test_cmp expect2 actual2 &&
diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh
index 793f0c8bf3..1a0d0e23d0 100755
--- a/t/t6409-merge-subtree.sh
+++ b/t/t6409-merge-subtree.sh
@@ -94,10 +94,10 @@ test_expect_success 'merge update' '
 	echo git-gui2 > git-gui.sh &&
 	o3=$(git hash-object git-gui.sh) &&
 	git add git-gui.sh &&
-	git checkout -b master2 &&
+	git checkout -b topic_2 &&
 	git commit -m "update git-gui" &&
 	cd ../git &&
-	git pull -s subtree gui master2 &&
+	git pull -s subtree gui topic_2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o3 0	git-gui/git-gui.sh" &&
@@ -109,7 +109,7 @@ test_expect_success 'merge update' '
 test_expect_success 'initial ambiguous subtree' '
 	cd ../git &&
 	git reset --hard master &&
-	git checkout -b master2 &&
+	git checkout -b topic_2 &&
 	git merge -s ours --no-commit gui/master &&
 	git read-tree --prefix=git-gui2/ -u gui/master &&
 	git commit -m "Merge git-gui2 as our subdirectory" &&
@@ -125,8 +125,8 @@ test_expect_success 'initial ambiguous subtree' '
 
 test_expect_success 'merge using explicit' '
 	cd ../git &&
-	git reset --hard master2 &&
-	git pull -Xsubtree=git-gui gui master2 &&
+	git reset --hard topic_2 &&
+	git pull -Xsubtree=git-gui gui topic_2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o3 0	git-gui/git-gui.sh" &&
@@ -138,8 +138,8 @@ test_expect_success 'merge using explicit' '
 
 test_expect_success 'merge2 using explicit' '
 	cd ../git &&
-	git reset --hard master2 &&
-	git pull -Xsubtree=git-gui2 gui master2 &&
+	git reset --hard topic_2 &&
+	git pull -Xsubtree=git-gui2 gui topic_2 &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	git-gui/git-gui.sh" &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH v3 5/5] t9902: avoid using the branch name `master`
  2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
                       ` (3 preceding siblings ...)
  2020-09-26 21:04     ` [PATCH v3 4/5] tests: " Johannes Schindelin via GitGitGadget
@ 2020-09-26 21:04     ` Johannes Schindelin via GitGitGadget
  2020-09-30 22:21     ` [PATCH v3 0/5] Inclusive naming, part II Junio C Hamano
  5 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-09-26 21:04 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Johannes Schindelin, Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

The completion tests used that name unnecessarily, and it is a
non-inclusive term, so let's avoid using it here.

Since three of the touched test cases make use of the fact that two of
the branch names (`master` and `maint`) start with the same letter (or
even with the same two letters), we choose to replace the use of
`master` by a name that also has that property: `main`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9902-completion.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 8425b9a531..7b7bc6e4bd 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -542,37 +542,37 @@ test_expect_success '__gitcomp - doesnt fail because of invalid variable name' '
 '
 
 read -r -d "" refs <<-\EOF
+main
 maint
-master
 next
 seen
 EOF
 
 test_expect_success '__gitcomp_nl - trailing space' '
 	test_gitcomp_nl "m" "$refs" <<-EOF
+	main Z
 	maint Z
-	master Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - prefix' '
 	test_gitcomp_nl "--fixup=m" "$refs" "--fixup=" "m" <<-EOF
+	--fixup=main Z
 	--fixup=maint Z
-	--fixup=master Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - suffix' '
 	test_gitcomp_nl "branch.ma" "$refs" "branch." "ma" "." <<-\EOF
+	branch.main.Z
 	branch.maint.Z
-	branch.master.Z
 	EOF
 '
 
 test_expect_success '__gitcomp_nl - no suffix' '
 	test_gitcomp_nl "ma" "$refs" "" "ma" "" <<-\EOF
+	mainZ
 	maintZ
-	masterZ
 	EOF
 '
 
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH v2 0/5] Inclusive naming, part II
  2020-09-26  4:29     ` Johannes Schindelin
@ 2020-09-27  8:45       ` Jeff King
  0 siblings, 0 replies; 38+ messages in thread
From: Jeff King @ 2020-09-27  8:45 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Johannes Schindelin via GitGitGadget, git

On Sat, Sep 26, 2020 at 06:29:50AM +0200, Johannes Schindelin wrote:

> > Thanks, I think that does look nicer. Shouldn't the latter bullet apply
> > to most of the ones in patch 4, though?
> >
> > I wonder if they should simply be "s/master/topic/" instead of
> > "s/master/main".
> 
> Yes! I did that in 4/5. In 5/5, we need a branch name that starts with the
> same two letters as `maint`, though. I amended the commit message
> accordingly.

That makes sense, and your commit message is clear. All of your v3 looks
good to me. Thanks for your patience on these rather tedious changes. :)

-Peff

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/5] Inclusive naming, part II
  2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
                       ` (4 preceding siblings ...)
  2020-09-26 21:04     ` [PATCH v3 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
@ 2020-09-30 22:21     ` Junio C Hamano
  2020-09-30 22:34       ` Jeff King
  5 siblings, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2020-09-30 22:21 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Jeff King, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> This patch series represents the logical next step on the journey begun with
> introducing init.defaultBranch: in these patches, we avoid a couple
> unnecessary mentions of the branch name "master".
>
> This patch series does not try to change the default branch name, although I
> have that patch series ready to go. You can see the overall idea here: 
> https://github.com/gitgitgadget/git/pull/655. Concretely, I plan on
> submitting three more patch series after this one:
>
>  1. a relatively small patch series to avoid using the branch name main in
>     the test suite. This is necessary because my plan is to change the
>     default branch name to that name, therefore it cannot be used as the
>     name of a topic branch any longer.
>  2. a relatively large patch series (currently consisting of 18 patches) to
>     change the default branch name to main. Most of the patches provide
>     non-trivial (read: non-scriptable) adjustments to the test suite in an
>     incremental fashion, with a big patch toward the end that reflects a
>     fully-automated search-and-replace of all the trivial cases.
>  3. a very small patch series with fall-out patches that are not necessary
>     to pass the test suite, but are still required to complete the rename
>     (adjusted code comment, file rename).
>
> (Note: I am still debating whether I should move one or two patches from the
> second to the third patch series)
>
> Changes since v2:
>
>  * Extended the idea of using topic instead of main to patch 4/5.
>  * Explained in the commit message of patch 5/5 why we cannot use topic 
>    instead of main here.

This round hasn't seen any new comments.  I quickly scanned them one
more time, and it seems to be in good shape.

Shall we merge it down to 'next'?

Thanks.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/5] Inclusive naming, part II
  2020-09-30 22:21     ` [PATCH v3 0/5] Inclusive naming, part II Junio C Hamano
@ 2020-09-30 22:34       ` Jeff King
  2020-09-30 22:57         ` Junio C Hamano
  0 siblings, 1 reply; 38+ messages in thread
From: Jeff King @ 2020-09-30 22:34 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

On Wed, Sep 30, 2020 at 03:21:02PM -0700, Junio C Hamano wrote:

> > Changes since v2:
> >
> >  * Extended the idea of using topic instead of main to patch 4/5.
> >  * Explained in the commit message of patch 5/5 why we cannot use topic 
> >    instead of main here.
> 
> This round hasn't seen any new comments.  I quickly scanned them one
> more time, and it seems to be in good shape.
> 
> Shall we merge it down to 'next'?

I had an "all of v3 looks good to me" comment, but it was perhaps a bit
buried. So yes, I think this is ready for 'next'.

-Peff

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH v3 0/5] Inclusive naming, part II
  2020-09-30 22:34       ` Jeff King
@ 2020-09-30 22:57         ` Junio C Hamano
  0 siblings, 0 replies; 38+ messages in thread
From: Junio C Hamano @ 2020-09-30 22:57 UTC (permalink / raw)
  To: Jeff King; +Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Jeff King <peff@peff.net> writes:

> On Wed, Sep 30, 2020 at 03:21:02PM -0700, Junio C Hamano wrote:
>
>> > Changes since v2:
>> >
>> >  * Extended the idea of using topic instead of main to patch 4/5.
>> >  * Explained in the commit message of patch 5/5 why we cannot use topic 
>> >    instead of main here.
>> 
>> This round hasn't seen any new comments.  I quickly scanned them one
>> more time, and it seems to be in good shape.
>> 
>> Shall we merge it down to 'next'?
>
> I had an "all of v3 looks good to me" comment, but it was perhaps a bit
> buried. So yes, I think this is ready for 'next'.

Ah, thanks and sorry for a confusing comment.  I meant by "new
comments" messages that point out issues yet to be addressed.


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2020-09-30 22:57 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 18:10 [PATCH 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
2020-09-16 18:10 ` [PATCH 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
2020-09-16 21:05   ` Junio C Hamano
2020-09-16 18:10 ` [PATCH 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
2020-09-16 21:05   ` Junio C Hamano
2020-09-16 21:25     ` Junio C Hamano
2020-09-20 15:34       ` Johannes Schindelin
2020-09-21 21:12         ` Junio C Hamano
2020-09-16 18:10 ` [PATCH 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
2020-09-16 21:11   ` Jeff King
2020-09-16 22:28     ` Junio C Hamano
2020-09-16 22:39       ` Jeff King
2020-09-20 15:43         ` Johannes Schindelin
2020-09-21 21:26           ` Junio C Hamano
2020-09-16 18:10 ` [PATCH 4/5] tests: " Johannes Schindelin via GitGitGadget
2020-09-16 18:10 ` [PATCH 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
2020-09-21 22:01 ` [PATCH v2 0/5] Inclusive naming, part II Johannes Schindelin via GitGitGadget
2020-09-21 22:01   ` [PATCH v2 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
2020-09-21 22:01   ` [PATCH v2 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
2020-09-21 22:01   ` [PATCH v2 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
2020-09-21 22:01   ` [PATCH v2 4/5] tests: " Johannes Schindelin via GitGitGadget
2020-09-21 22:31     ` Junio C Hamano
2020-09-26  4:20       ` Johannes Schindelin
2020-09-21 22:01   ` [PATCH v2 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
2020-09-21 22:35     ` Junio C Hamano
2020-09-26  4:25       ` Johannes Schindelin
2020-09-21 22:24   ` [PATCH v2 0/5] Inclusive naming, part II Jeff King
2020-09-26  4:29     ` Johannes Schindelin
2020-09-27  8:45       ` Jeff King
2020-09-26 21:04   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
2020-09-26 21:04     ` [PATCH v3 1/5] fast-export: avoid using unnecessary language in a code comment Johannes Schindelin via GitGitGadget
2020-09-26 21:04     ` [PATCH v3 2/5] t/test-terminal: avoid non-inclusive language Johannes Schindelin via GitGitGadget
2020-09-26 21:04     ` [PATCH v3 3/5] t3200: avoid variations of the `master` branch name Johannes Schindelin via GitGitGadget
2020-09-26 21:04     ` [PATCH v3 4/5] tests: " Johannes Schindelin via GitGitGadget
2020-09-26 21:04     ` [PATCH v3 5/5] t9902: avoid using the branch name `master` Johannes Schindelin via GitGitGadget
2020-09-30 22:21     ` [PATCH v3 0/5] Inclusive naming, part II Junio C Hamano
2020-09-30 22:34       ` Jeff King
2020-09-30 22:57         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).