Subject: Re: [PATCH 4/6] t0613: stop setting default initial branch

From: Junio C Hamano <[email-masked]>
Date: Wed, 27 Aug 2025 10:30:46 -0700

Phillip Wood <[email-masked]> writes:

> From: Phillip Wood <[email-masked]>
>
> As the tests are all run in separate repositories, set the branch
> name to "master" when creating the repository for the tests where
> the result depends on the branch name. This is in preparation for
> removing GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in Git 3.0.

I do not agree with the statement that Git 3.0 should remove support
for GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME facility in its test suite,
so it is somewhat moot for me to review almost all the patches in
this series, but this caught my attention.  As this one needs to fix
the initial branch name to a fixed string, no matter the hardcoded
initial branch name of the time is (even after we rename again from
'main' to something else), I do think this change is VERY MUCH a
good thing to do.

> Signed-off-by: Phillip Wood <[email-masked]>
> ---
>  t/t0613-reftable-write-options.sh | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/t/t0613-reftable-write-options.sh b/t/t0613-reftable-write-options.sh
> index d77e601111f..b547e12d66d 100755
> --- a/t/t0613-reftable-write-options.sh
> +++ b/t/t0613-reftable-write-options.sh
> @@ -11,16 +11,12 @@ export GIT_TEST_REFTABLE_AUTOCOMPACTION
>  # Block sizes depend on the hash function, so we force SHA1 here.
>  GIT_TEST_DEFAULT_HASH=sha1
>  export GIT_TEST_DEFAULT_HASH
> -# Block sizes also depend on the actual refs we write, so we force "master" to
> -# be the default initial branch name.

We may however need to keep this comment somewhere in this file, to
warn against future developers that all "git init" invocations must
use 'master' (by the way, would any 6-byte name do?  I dunno) as the
initial branch name.

> -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
> -export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>  
>  . ./test-lib.sh
>  
>  test_expect_success 'default write options' '
>  	test_when_finished "rm -rf repo" &&
> -	git init repo &&
> +	git init --initial-branch master repo &&

And being explict like this is a good idea.

I am curious how the CC: list was formulated, though, as neither
name comes up in "git shortlog t/t0613-reftable-write-options.sh".

I've added Patrick for comment (primarily to pick his brain for the
6-byte thing).

Thanks.