git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH v3 3/5] t3200: avoid variations of the `master` branch name
Date: Sat, 26 Sep 2020 21:04:20 +0000	[thread overview]
Message-ID: <8d8e9abfe2ad141a75ee54446393f8b54b1fb990.1601154262.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.734.v3.git.1601154262.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. 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


  parent reply	other threads:[~2020-09-26 21:04 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Johannes Schindelin via GitGitGadget [this message]
2020-09-26 21:04     ` [PATCH v3 4/5] tests: avoid variations of the `master` branch name 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d8e9abfe2ad141a75ee54446393f8b54b1fb990.1601154262.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).