git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/5] t3200: avoid variations of the `master` branch name

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 16, 2020, 18:10 UTC
Message-ID
<2f1d0a2df41f567bc1a8bc446c26e1cb8b6dc36c.1600279853.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.734.git.1600279853.gitgitgadget@gmail.com>
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
Previous: Johannes Schindelin via GitGitGadgetNext: Jeff King
Message 2 of 38 in “Inclusive naming, part II”
  1. 0/5 Inclusive naming, part IIJohannes Schindelin via GitGitGadget, Sep 16, 2020
  2. 3/5 t3200: avoid variations of the `master` branch nameJohannes Schindelin via GitGitGadget, Sep 16, 2020
  3. Jeff KingSep 16, 2020
  4. Junio C HamanoSep 16, 2020
  5. Jeff KingSep 16, 2020
  6. Johannes SchindelinSep 20, 2020
  7. Junio C HamanoSep 21, 2020
  8. 4/5 tests: avoid variations of the `master` branch nameJohannes Schindelin via GitGitGadget, Sep 16, 2020
  9. 5/5 t9902: avoid using the branch name `master`Johannes Schindelin via GitGitGadget, Sep 16, 2020
  10. 2/5 t/test-terminal: avoid non-inclusive languageJohannes Schindelin via GitGitGadget, Sep 16, 2020
  11. Junio C HamanoSep 16, 2020
  12. Junio C HamanoSep 16, 2020
  13. Johannes SchindelinSep 20, 2020
  14. Junio C HamanoSep 21, 2020
  15. 1/5 fast-export: avoid using unnecessary language in a code commentJohannes Schindelin via GitGitGadget, Sep 16, 2020
  16. Junio C HamanoSep 16, 2020
  17. 0/5 Inclusive naming, part IIJohannes Schindelin via GitGitGadget, Sep 21, 2020
  18. 1/5 fast-export: avoid using unnecessary language in a code commentJohannes Schindelin via GitGitGadget, Sep 21, 2020
  19. 3/5 t3200: avoid variations of the `master` branch nameJohannes Schindelin via GitGitGadget, Sep 21, 2020
  20. 4/5 tests: avoid variations of the `master` branch nameJohannes Schindelin via GitGitGadget, Sep 21, 2020
  21. Junio C HamanoSep 21, 2020
  22. Johannes SchindelinSep 26, 2020
  23. 5/5 t9902: avoid using the branch name `master`Johannes Schindelin via GitGitGadget, Sep 21, 2020
  24. Junio C HamanoSep 21, 2020
  25. Johannes SchindelinSep 26, 2020
  26. 2/5 t/test-terminal: avoid non-inclusive languageJohannes Schindelin via GitGitGadget, Sep 21, 2020
  27. Jeff KingSep 21, 2020
  28. Johannes SchindelinSep 26, 2020
  29. Jeff KingSep 27, 2020
  30. 0/5 Inclusive naming, part IIJohannes Schindelin via GitGitGadget, Sep 26, 2020
  31. 1/5 fast-export: avoid using unnecessary language in a code commentJohannes Schindelin via GitGitGadget, Sep 26, 2020
  32. 2/5 t/test-terminal: avoid non-inclusive languageJohannes Schindelin via GitGitGadget, Sep 26, 2020
  33. 4/5 tests: avoid variations of the `master` branch nameJohannes Schindelin via GitGitGadget, Sep 26, 2020
  34. 3/5 t3200: avoid variations of the `master` branch nameJohannes Schindelin via GitGitGadget, Sep 26, 2020
  35. 5/5 t9902: avoid using the branch name `master`Johannes Schindelin via GitGitGadget, Sep 26, 2020
  36. Junio C HamanoSep 30, 2020
  37. Jeff KingSep 30, 2020
  38. Junio C HamanoSep 30, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.