Re: [PATCH 00/28] Use main as default branch name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 18, 2020, 05:43 UTC
- Message-ID
- <xmqqima343vb.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20201118024028.GE360414@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 11 quoted lines
>> 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).