From: Matheus Tavares Bernardino Date: Sun, 10 May 2020 04:23:29 GMT Subject: Re: [RFC PATCH v2 4/4] config: add setting to ignore sparsity patterns in some cmds Message-ID: In-Reply-To: <3e9e90624901113fd5c5670c0c2023c709f71d6d.1589058209.git.matheus.bernardino@usp.br> On Sat, May 9, 2020 at 9:42 PM Matheus Tavares wrote: > > diff --git a/t/t7817-grep-sparse-checkout.sh b/t/t7817-grep-sparse-checkout.sh > index 3bd67082eb..8509694bf1 100755 > --- a/t/t7817-grep-sparse-checkout.sh > +++ b/t/t7817-grep-sparse-checkout.sh > @@ -63,12 +63,28 @@ test_expect_success 'setup' ' > test_path_is_file sub/B/b > ' > > +# The two tests bellow check a special case: the sparsity patterns exclude '/b' > +# and sparse checkout is enable, but the path exists on the working tree (e.g. > +# manually created after `git sparse-checkout init`). In this case, grep should > +# honor --restrict-to-sparse-paths. I just want to highlight a small thing that I forgot to comment on: Elijah and I had already discussed about --restrict-to-sparse-paths being relevant in grep only with --cached or when a commit-ish is given. But it had not occurred to me, before, the possibility of the special case mentioned above. I.e. when searching in the working tree and a path that should be excluded by the sparsity patterns is present. In this patch, I let --restrict-to-sparse-paths control the desired behavior for grep in this case too. But please, let me know if that doesn't seem like a good idea.