On Mon, Nov 16, 2020 at 6:30 AM Jeff Hostetler <git@xxxxxxxxxxxxxxxxx> wrote: > > On 11/13/20 8:47 AM, Derrick Stolee wrote: > > On 11/12/2020 6:54 PM, Elijah Newren wrote: > >> Hi, > >> > >> On Thu, Nov 12, 2020 at 1:02 PM Matheus Tavares > >> <matheus.bernardino@xxxxxx> 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?? Good point. I suspect, though, that the issue may still be a problem if the user were to quote the wildcards; that may have been what happened and the reporting of the case just lost them somewhere along the way.