Thread (24 messages) 24 messages, 6 authors, 2022-03-02

Re: [PATCH] Provide config option to expect files outside sparse patterns

From: Elijah Newren <hidden>
Date: 2022-02-22 02:23:17

On Mon, Feb 21, 2022 at 12:34 PM Johannes Schindelin
[off-list ref] wrote:
Hi Elijah,

In addition to Stolee's feedback...

On Sun, 20 Feb 2022, Elijah Newren via GitGitGadget wrote:
quoted
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`?
That's a fair point.  At one point Stolee wanted to change from
core.sparse* to sparse.* -- but by that point we already had users and
would have had to deal with a bit of a migration story (and wondering
what to do if people had both old and new config variables set
inconsistently).

I'm not sure if it's optimal to try to keep the sparse settings
together (thus put new ones under core), or try to avoid filling core.
I guess if we moved towards sparse.* now, it might be an easier
migration story if we only have two options to move.  And besides,
we're already split between multiple sections with
extensions.worktreeConfig, core.sparseCheckout{,Cone}, and
index.sparse already...so maybe adding one more section would be par
for the course.  ;-)

So, I'm leaning towards sparse.expectFilesOutsideOfPatterns, but I'd
like to hear Stolee's thoughts too.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help