From: Vsevolod Myalitsin Date: Thu, 10 Sep 2026 04:43:07 GMT Subject: Re: [PATCH v3] advice: use global config for default branch name Message-ID: <20260910044307.95376-1-ub4nal@mail.ru> In-Reply-To: <20260909224603.GA195381@coredump.intra.peff.net> > Any config can work at any scope. These are really just recommendations on where the user might want to write a value. Looking at it from that perspective, this seems obvious to me now. I'll reuse the existing CONFIG_SCOPE enum and treat CONFIG_SCOPE_UNKNOWN as the default location. > TBH, I am not really sure what the criteria are for suggesting one advice option as --global or not. The motivation for this patch was that "advice.defaultBranchName" currently suggests: "git config set advice.defaultBranchName false" Without an explicit scope, this writes to the local ".git/config". After the repository has been initialized, that particular scenario won't occur again in that repository. However, when the user initializes a new repository, the advice will appear again, which may make them wonder why they ran the command in the first place. Therefore, I think "defaultBranchName" should suggest using the global scope. > I'd think most of them are about squelching advice that the user already knows about, and thus they would go into --global. I agree that this may apply to many of the advice messages. For this patch, though, I'm specifically addressing "defaultBranchName", where the global scope seems appropriate for the reason above. > I didn't really follow the earlier discussion that led up to this patch, though. The original motivation was specifically the behavior of "defaultBranchName" after initializing a new repository, which is why I considered a global scope recommendation here. Vsevolod