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

Re: [PATCH 1/4] t5411: start using the default branch name "main"

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 30, 2020, 15:04 UTC
Message-ID
<nycvar.QRO.7.76.6.2010301559540.18437@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqq5z6u9kkv.fsf@gitster.c.googlers.com>
Hi Junio,
On Wed, 28 Oct 2020, Junio C Hamano wrote:
Show 27 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
> >> +test_have_prereq PREPARE_FOR_MAIN_BRANCH || {
> >> +	test_skip="In transit for the default branch name 'main'"
> >> +	test_done
> >> +}
> >> +
> >
> > IOW, I do not see the point in _conditionally_ skipping the rest of
> > the test in this step.  I'd however understand it if we always skip
> > the rest in 1/4 and then enable the rest only when testing with
> > 'main' as the default in 4/4, when all the necessary pieces in
> > t/t5411 have been converted.
>
> Another way to protect the test well would be to keep the "unless
> testing with master, skip all" prerequisite check you wrote above,
> but add
>
>     GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
>
> immediately before that.  We can flip it to use 'master' at the
> final step in the series.
>
> That way, we will not be affected by the GIT_TEST_* environment
> variable that is passed to these scripts by the tester.  I think
> I'd prefer to do it that way, instead of unconditionally skipping,
> as the result would be more self explanatory.
Do you mean that this patch, squashed into 1/4:
-- snip --
diff --git a/t/t5411-proc-receive-hook.sh b/t/t5411-proc-receive-hook.sh
index 06bbb02ed22..6da6f597a50 100755
--- a/t/t5411-proc-receive-hook.sh
+++ b/t/t5411-proc-receive-hook.sh
@@ -5,6 +5,9 @@

 test_description='Test proc-receive hook'

+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh

 test_have_prereq PREPARE_FOR_MAIN_BRANCH || {

-- snap --

so that 4/4 starts with:

-- snip --
diff --git a/t/t5411-proc-receive-hook.sh b/t/t5411-proc-receive-hook.sh
index 6da6f597a50..98b0e812082 100755
--- a/t/t5411-proc-receive-hook.sh
+++ b/t/t5411-proc-receive-hook.sh
@@ -5,16 +5,11 @@

 test_description='Test proc-receive hook'

-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME

 . ./test-lib.sh

-test_have_prereq PREPARE_FOR_MAIN_BRANCH || {
-	test_skip="In transit for the default branch name 'main'"
-	test_done
-}
-
 . "$TEST_DIRECTORY"/t5411/common-functions.sh

 setup_upstream_and_workbench () {
-- snap --

would be much more understandable?

If so, I agree, and I will gladly send off the next iteration with that
change.

If I misunderstood, can I please ask you to give it another try to explain
it to me?

Thanks,
Dscho
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 14 in “Adjust t5411 for the upcoming change of the default branch name”
  1. 0/4 Adjust t5411 for the upcoming change of the default branch nameJohannes Schindelin via GitGitGadget, Oct 27, 2020
  2. 1/4 t5411: start using the default branch name "main"Johannes Schindelin via GitGitGadget, Oct 27, 2020
  3. Junio C HamanoOct 28, 2020
  4. Junio C HamanoOct 28, 2020
  5. Johannes SchindelinOct 30, 2020
  6. Junio C HamanoOct 30, 2020
  7. 4/4 t5411: finish preparing for `main` being the default branch nameJohannes Schindelin via GitGitGadget, Oct 27, 2020
  8. 3/4 t5411: adjust the remaining support files for init.defaultBranch=mainJohannes Schindelin via GitGitGadget, Oct 27, 2020
  9. 2/4 t5411: start adjusting the support files for init.defaultBranch=mainJohannes Schindelin via GitGitGadget, Oct 27, 2020
  10. 0/4 Adjust t5411 for the upcoming change of the default branch nameJohannes Schindelin via GitGitGadget, Oct 31, 2020
  11. 1/4 t5411: start using the default branch name "main"Johannes Schindelin via GitGitGadget, Oct 31, 2020
  12. 4/4 t5411: finish preparing for `main` being the default branch nameJohannes Schindelin via GitGitGadget, Oct 31, 2020
  13. 3/4 t5411: adjust the remaining support files for init.defaultBranch=mainJohannes Schindelin via GitGitGadget, Oct 31, 2020
  14. 2/4 t5411: start adjusting the support files for init.defaultBranch=mainJohannes Schindelin via GitGitGadget, Oct 31, 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.