Subject: Re: [PATCH 00/28] Use main as default branch name

From: Junio C Hamano <[email-masked]>
Date: Tue, 17 Nov 2020 21:43:04 -0800

Jonathan Nieder <[email-masked]> writes:

>> IMHO, though, all of this is orthogonal to question of what the default
>> is. Unless we are thinking the basename thing would work as a default,
>> but I don't think that resolves any of the backwards-compatibility
>> concerns.
>
> If we think it would make sense as the *eventual* default, we could use
>
> 	[init]
> 		defaultBranchName =
>
> (i.e., an empty string) to request it early.

I am not opposed to the idea to invent a notation that asks for the
basename behaviour, but I do not think it is a good idea to use "an
empty string" for that.  I'd rather see us use some consistent
naming convention to denote any new "non-constant string" thing.

What Peff suggested is a more viable possibility, for example.  When
"[init] defaultBranchAlgorithm = <name>" is set, the fixed string
"init.defaultBranch" is ignored and the algorithm specified with its
name is invoked to come up with a name dynamically.  We may start
with something like 'dirname' as the only supported algorithm but
that way we would avoid painting ourselves in a corner out of which
we cannot escape (e.g. we may come up with a better way than the
basename thing, and we would not have a good way to give it a name
that is easy to use if we wasted "an empty string" for the basename
thing).