Re: [RFC/PATCH] ls-files: adding support for submodules
- From
Stefan Beller <sbeller@google.com>
- Date
- Sep 9, 2016, 23:47 UTC
- Message-ID
- <CAGZ79kaWNykEAZcjZ2Y19j2_3TF+qcz+vb8zSi1U+me3k+06LA@mail.gmail.com>
- In-Reply-To
- <xmqqh99o8ypm.fsf@gitster.mtv.corp.google.com>
On Fri, Sep 9, 2016 at 4:01 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Brandon Williams <bmwill@google.com> writes:
>
>> Allow ls-files to recognize submodules in order to retrieve a list of
>> files from a repository's submodules. This is done by forking off a
>> process to recursively call ls-files on all submodules.
>
> While I see why "ls-files --recurse-submodules" sounds nice ("hey, I
> can get list of _all_ the files here"), and I am quite happy with
> the quality of implementation (not just the code but its
> documentation and test)The plan is to hook the ls-files machinery into git-grep as the way of obtaining files to grep for a pattern.
As git-grep has a thread pool already, getting the list of files single threaded is more beneficial as e.g. calling git-grep recursively for submodules, as then you may have a fork bomb.
> >> diff --git a/t/t3007-ls-files-recurse-submodules.sh b/t/t3007-ls-files-recurse-submodules.sh
> We used to do that when we didn't know better. >
Oops, a lot of stuff slipped through the first internal review.