Re: [PATCH v2 6/9] read_early_config(): special-case builtins that create a repository
- From
Jeff King <peff@peff.net>
- Date
- Mar 3, 2017, 04:51 UTC
- Message-ID
- <20170303045101.om7qtbcmtuw6kzvr@sigill.intra.peff.net>
- In-Reply-To
- <33e692918c8d41507de5ec2b2e2d55982678408e.1488506615.git.johannes.schindelin@gmx.de>
On Fri, Mar 03, 2017 at 03:04:24AM +0100, Johannes Schindelin wrote:
> When the command we are about to execute wants to create a repository > (i.e. the command is `init` or `clone`), we *must not* look for a > repository config.
Hmm. I'm not sure if this one is worth the hackery here.
Yes, it would be wrong for init or clone to read something like core.sharedrepository from a repo it happens to be in. But I wonder if it would be cleaner to consider calls to read_early_config their own "pre-command" stage that may respect global config, or config in a repo directory you happen to be sitting in.
Because I think for aliases, we're going to end up having to do that anyway (you won't know that your alias is "clone" until you've resolved it!). And I think the pager fits into this "pre-command" concept, too (we already have "-p" as a pre-command option on the command-line).
I dunno. It probably doesn't matter _too much_ either way. But it's one less hack to maintain going forward, and it also makes your "git-init respects the pager" into the normal, consistent thing.
-Peff