From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 8CD6B1F66F for ; Wed, 18 Nov 2020 01:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbgKRBZp (ORCPT ); Tue, 17 Nov 2020 20:25:45 -0500 Received: from cloud.peff.net ([104.130.231.41]:33302 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726205AbgKRBZp (ORCPT ); Tue, 17 Nov 2020 20:25:45 -0500 Received: (qmail 19948 invoked by uid 109); 18 Nov 2020 01:25:45 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Wed, 18 Nov 2020 01:25:45 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 7095 invoked by uid 111); 18 Nov 2020 01:25:44 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 17 Nov 2020 20:25:44 -0500 Authentication-Results: peff.net; auth=none Date: Tue, 17 Nov 2020 20:25:44 -0500 From: Jeff King To: Junio C Hamano Cc: Felipe Contreras , "Eric W. Biederman" , Johannes Schindelin via GitGitGadget , Git , Johannes Schindelin Subject: Re: [PATCH 00/28] Use main as default branch name Message-ID: <20201118012544.GC650959@coredump.intra.peff.net> References: <87r1oraewl.fsf@x220.int.ebiederm.org> <20201117233313.GB642410@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Nov 17, 2020 at 04:07:28PM -0800, Junio C Hamano wrote: > Jeff King 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