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
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2020, 20:00 UTC
Message-ID
<xmqqa6w69l3j.fsf@gitster.c.googlers.com>
In-Reply-To
<f997166db4c29d971a2343f70c9d9a0505a8cc4b.1603839487.git.gitgitgadget@gmail.com>

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

Show 7 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> This is a straight-forward search-and-replace in the test script;
> However, this is not yet complete because it requires many more
> replacements in `t/t5411/`, too many for a single patch (the Git mailing
> list rejects mails larger than 100kB). For that reason, we disable this
> test script temporarily via the `PREPARE_FOR_MAIN_BRANCH` prereq.

I do not think it matters too much, as it will become correct at the end anyway, but ...

Show 5 quoted lines
> +test_have_prereq PREPARE_FOR_MAIN_BRANCH || {
> +	test_skip="In transit for the default branch name 'main'"
> +	test_done
> +}
> +

... the way I read the introductory paragraph in the proposed log message is that the point of adding a protection here (done in order to work around a transient failure caused by having to artificially split this topic into four patches) is to avoid an inevitable failure due to some parts of tests adjusted for 'main' while other parts still expect 'master'. Until files in t/5411/* gets adjusted for 'main', nothing is expected to pass whether the default branch is 'master' or 'main'. Or with only 1/4 applied, is this test expected to pass if GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME is set to 'main' (i.e. PREPARE_FOR_MAIN_BRANCH prerequisite is satisfied)?

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.

The "straight-forward search-and-replace" part looks obviously good, of course.

Thanks.
Show 35 quoted lines
>  . "$TEST_DIRECTORY"/t5411/common-functions.sh
>  
>  setup_upstream_and_workbench () {
> -	# Refs of upstream : master(A)
> -	# Refs of workbench: master(A)  tags/v123
> +	# Refs of upstream : main(A)
> +	# Refs of workbench: main(A)  tags/v123
>  	test_expect_success "setup upstream and workbench" '
>  		rm -rf upstream.git &&
>  		rm -rf workbench &&
> @@ -25,10 +30,10 @@ setup_upstream_and_workbench () {
>  			git config core.abbrev 7 &&
>  			git tag -m "v123" v123 $A &&
>  			git remote add origin ../upstream.git &&
> -			git push origin master &&
> -			git update-ref refs/heads/master $A $B &&
> +			git push origin main &&
> +			git update-ref refs/heads/main $A $B &&
>  			git -C ../upstream.git update-ref \
> -				refs/heads/master $A $B
> +				refs/heads/main $A $B
>  		) &&
>  		TAG=$(git -C workbench rev-parse v123) &&
>  
> @@ -99,8 +104,8 @@ start_httpd
>  # Re-initialize the upstream repository and local workbench.
>  setup_upstream_and_workbench
>  
> -# Refs of upstream : master(A)
> -# Refs of workbench: master(A)  tags/v123
> +# Refs of upstream : main(A)
> +# Refs of workbench: main(A)  tags/v123
>  test_expect_success "setup for HTTP protocol" '
>  	git -C upstream.git config http.receivepack true &&
>  	upstream="$HTTPD_DOCUMENT_ROOT_PATH/upstream.git" &&
Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 3 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.