Re: [RFC] extending pathspec support to submodules

2016-09-16 Thread Brandon Williams
On Thu, Sep 15, 2016 at 3:08 PM, Junio C Hamano wrote: > > * Your program that runs in the top-level superproject still needs >to be able to say "this pathspec from the top cannot possibly >match anything in the submodule, so let's not even bother >descending into it". > Yes, we woul

Re: [RFC] extending pathspec support to submodules

2016-09-16 Thread Heiko Voigt
Hi, On Thu, Sep 15, 2016 at 03:28:21PM -0700, Stefan Beller wrote: > On Thu, Sep 15, 2016 at 3:08 PM, Junio C Hamano wrote: > > Brandon Williams writes: > > > >> You're right that seems like the best course of action and it already falls > >> inline with what I did with a first patch to ls-files

Re: [RFC] extending pathspec support to submodules

2016-09-15 Thread Stefan Beller
On Thu, Sep 15, 2016 at 3:08 PM, Junio C Hamano wrote: > Brandon Williams writes: > >> You're right that seems like the best course of action and it already falls >> inline with what I did with a first patch to ls-files to support submodules. >> In that patch I did exactly as you suggest and pass

Re: [RFC] extending pathspec support to submodules

2016-09-15 Thread Junio C Hamano
Brandon Williams writes: > You're right that seems like the best course of action and it already falls > inline with what I did with a first patch to ls-files to support submodules. > In that patch I did exactly as you suggest and pass in the prefix to the > submodule and make the child responsib

Re: [RFC] extending pathspec support to submodules

2016-09-15 Thread Brandon Williams
On Thu, Sep 15, 2016 at 4:57 AM, Heiko Voigt wrote: > > The problem when you do that is that the child is not aware that it is > actually run as a submodule process. E.g. > >git grep --recurse-submodules foobar -- sub/dir/a > > would report back matches in 'dir/a' instead of 'sub/dir/a'. From

Re: [RFC] extending pathspec support to submodules

2016-09-15 Thread Heiko Voigt
Hi, On Wed, Sep 14, 2016 at 04:57:53PM -0700, Brandon Williams wrote: > --- > I've been trying to think through how we could potentially add pathspec > support > for --recurse-submodule options (for builtins like ls-files or grep down the > line).  This is something that could be useful if the us

[RFC] extending pathspec support to submodules

2016-09-14 Thread Brandon Williams
--- I've been trying to think through how we could potentially add pathspec support for --recurse-submodule options (for builtins like ls-files or grep down the line).  This is something that could be useful if the user supply's a pathspec that could match to a file in a submodule.  We could match