Re: [PATCH] Provide config option to expect files outside sparse patterns
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 22, 2022, 02:25 UTC
- Message-ID
- <CABPp-BHmU8-a+McANE2bdAndGEtVudr74FHEEj6K6NwYECEZ6Q@mail.gmail.com>
- In-Reply-To
- <220221.86a6ejakun.gmgdl@evledraar.gmail.com>
On Mon, Feb 21, 2022 at 2:57 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 37 quoted lines
>
> On Mon, Feb 21 2022, Johannes Schindelin wrote:
>
> > Hi Elijah,
> >
> > In addition to Stolee's feedback...
> >
> > On Sun, 20 Feb 2022, Elijah Newren via GitGitGadget wrote:
> >
> >> diff --git a/config.c b/config.c
> >> index 2bffa8d4a01..68e877a1d80 100644
> >> --- a/config.c
> >> +++ b/config.c
> >> @@ -1520,6 +1520,11 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
> >> return 0;
> >> }
> >>
> >> + if (!strcmp(var, "core.expectfilesoutsidesparsepatterns")) {
> >> + core_expect_files_outside_sparse_patterns = git_config_bool(var, value);
> >> + return 0;
> >> + }
> >
> > The `core` section is already quite crowded (for which I am partially
> > responsible, of course).
> >
> > Maybe it would be a good idea to introduce the `sparse` section, using
> > `sparse.allowFilesMatchingPatterns` or `sparse.applyPatternsToWorktree =
> > false`?
>
> There's a large list of exceptions to this, but generally we have core.*
> for cross-command configuration, and <cmd>.* for command-specific
> configuration.
>
> Excetions include http.*, mailmap.*, pack.* (arguably), trace2.*.
>
> In this case though we have 2x /^core\.sparse[A-Z].*/ variables in
> git-config(1) already.Those wouldn't be an exception as worded. They are very much cross-command configuration variables, affecting basically every command that touches the working tree.
Show 8 quoted lines
> So perhaps we could name it like that, then at least you'd find all of > these in the same place when looking through that documentation, > although a name starting with "core.sparse" might not be otherwise > ideal. > > There's also no law that says we can't have a three-level variable as > core.sparse.*, perhaps that would be the start of a good trend, and it > would sort adjacent to core.sparse[A-Z].* ...
Interesting thought. I'm curious what others think of this.