Re: [RFC PATCH v2 3/4] grep: honor sparse checkout patterns
- From
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
- Date
- May 21, 2020, 17:35 UTC
- Message-ID
- <CAHd-oW7K+OVjScLmL34ctQMYRPqz3B+nc9mNP+v1b2JbaNoMsw@mail.gmail.com>
- In-Reply-To
- <CABPp-BFiPO_Hg-F2edv9GVQSqJCNj6NvOaB5Ez8UUzAMPdTqUw@mail.gmail.com>
On Thu, May 21, 2020 at 4:26 AM Elijah Newren <newren@gmail.com> wrote:
Show 16 quoted lines
>
> On Tue, May 12, 2020 at 5:17 PM Junio C Hamano <gitster@pobox.com> wrote:
> >
> > Matheus Tavares Bernardino <matheus.bernardino@usp.br> writes:
> >
> > > The idea behind not skipping gitlinks here was to be compliant with
> > > what we have in the working tree. In 4fd683b ("sparse-checkout:
> > > document interactions with submodules"), we decided that, if the
> > > sparse-checkout patterns exclude a submodule, the submodule would
> > > still appear in the working tree. The purpose was to keep these
> > > features (submodules and sparse-checkout) independent. Along the same
> > > lines, I think we should always recurse into initialized submodules in
>
> Sorry if I missed it in the code, but do you check whether the
> submodule is initialized before descending into it, or do you descend
> into it based on it just being a submodule?We only descend if the submodule is initialized. The new code in this patch doesn't do this check, but it is already implemented in grep_submodule() (which is called by grep_tree() and grep_cache() when a submodule is found).