Re: [PATCH] rm: honor sparse checkout patterns
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Nov 16, 2020, 14:30 UTC
- Message-ID
- <be43763e-6931-3e84-8e5a-0ac839cc0566@jeffhostetler.com>
- In-Reply-To
- <70ae5b1d-b1d2-1b3f-11cf-8e5ceafe6048@gmail.com>
On 11/13/20 8:47 AM, Derrick Stolee wrote:
Show 21 quoted lines
> On 11/12/2020 6:54 PM, Elijah Newren wrote: >> Hi, >> >> On Thu, Nov 12, 2020 at 1:02 PM Matheus Tavares >> <matheus.bernardino@usp.br> wrote: >>> >>> Make git-rm honor the 'sparse.restrictCmds' setting, by restricting its >>> operation to the paths that match both the command line pathspecs and >>> the repository's sparsity patterns. This better matches the expectations >>> of users with sparse-checkout definitions, while still allowing them >>> to optionally enable the old behavior with 'sparse.restrictCmds=false' >>> or the global '--no-restrict-to-sparse-paths' option. >> >> (For Stolee:) Did this arise when a user specified a directory to >> delete, and a (possibly small) part of that directory was in the >> sparse checkout while other portions of it were outside? > > The user who suggested this used a command like 'git rm */*.csprojx' to > remove all paths with that file extension, but then realized that they > were deleting all of those files from the entire repo, not just the > current sparse-checkout.
Aren't the wildcards expanded by the shell before the command line is given to Git? So the Git command should only receive command line args that actually match existing files, right??
Jeff