Re: [RFC PATCH v2 4/4] config: add setting to ignore sparsity patterns in some cmds
- From
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
- Date
- May 10, 2020, 04:23 UTC
- Message-ID
- <CAHd-oW6-A6_3FTskMWHvD5=23SLRFU19s2JrYMx3f94i-uB27Q@mail.gmail.com>
- In-Reply-To
- <3e9e90624901113fd5c5670c0c2023c709f71d6d.1589058209.git.matheus.bernardino@usp.br>
On Sat, May 9, 2020 at 9:42 PM Matheus Tavares <matheus.bernardino@usp.br> wrote:
Show 13 quoted lines
> > 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.