On Tue, Nov 17, 2020 at 04:07:28PM -0800, Junio C Hamano wrote: > Jeff King <peff@xxxxxxxx> writes: > > > I think Eric's suggestion of using the directory name as a default was > > not previously mentioned. I'm not sure I would like that myself (I find > > value in having a consistent "this is the main branch" name across > > different repositories, at least for my workflows). And it creates all > > of the same "every tutorial is now out of date" issues. But it is > > neutral. I wouldn't be opposed to seeing it as a configurable option. > > I actually recall hearing it from Eric, not on this list, directly > back in the timeframe of these previous dicsussions. I somehow > thought I relayed it to the community, perhaps #git-devel on > freenode, but apparently not to this list. Could be. I don't keep up with the irc logs. > Yes, init.defaultBranchName is defined to be a string, so it is a > bit tricky to introduce special values that mean "no, not a > hardcoded value but derive dynamically based on X". Perhaps use a > prefix that is not allowed in a refname, perhaps like this update to > the function that uses the value read from the init.defaultBranch > configuration variable. Yeah, I restrained myself from getting too far into thinking about syntax, but I agree we'd want something like that. It might also be OK to use something that's extremely unlikely to be a default branch name (like BASENAME), but the ":" syntax you have here isn't bad. Yet another option is a separate variable (that if set means we do not look at init.defaultBranch at all). 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. -Peff