Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-12 Thread Brandon Williams
Thanks for all the comments. What it sounds like is that using ls-files as a means to power a recursive git-grep may not be like the best approach (I assumed that would be the case but thought it a decent place to start). I agree that not all operating modes would be useful for a recursive ls-fil

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-12 Thread Junio C Hamano
Jeff King writes: >> I do not use submodules myself, but I could imagine that you may have >> scripts outside of git that do not care about the submodule divisions at >> all, and would be happy with the flat block. ... >> git-grep does not (I don't use "ack", but perhaps "git ls-files >> --recurs

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-11 Thread Junio C Hamano
Junio C Hamano writes: > So a "ls-files" that is done internally in the end-user facing "git > grep --recurse-submodules" needs to be run _without_ recursing > itself at least once to learn "lib/" is a submodule. A flat "here > are everything we have" does not sound like a good building block.

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-11 Thread Jeff King
On Sun, Sep 11, 2016 at 08:51:06PM -0400, Jeff King wrote: > On Sun, Sep 11, 2016 at 03:10:13PM -0700, Junio C Hamano wrote: > > > So a "ls-files" that is done internally in the end-user facing "git > > grep --recurse-submodules" needs to be run _without_ recursing > > itself at least once to lea

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-11 Thread Jeff King
On Sun, Sep 11, 2016 at 03:10:13PM -0700, Junio C Hamano wrote: > So a "ls-files" that is done internally in the end-user facing "git > grep --recurse-submodules" needs to be run _without_ recursing > itself at least once to learn "lib/" is a submodule. A flat "here > are everything we have" does

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-11 Thread Junio C Hamano
Stefan Beller writes: > The plan is to hook the ls-files machinery into > git-grep as the way of obtaining files to grep for a pattern. That does not make much sense to me for exactly the same reason why the "grab the list of paths and run 'git add' on them" example in the message you are respon

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-09 Thread Stefan Beller
On Fri, Sep 9, 2016 at 4:01 PM, Junio C Hamano wrote: > Brandon Williams 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

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-09 Thread Junio C Hamano
Brandon Williams 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 c

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-09 Thread Junio C Hamano
Jeff King writes: > So I suppose another option would be to teach ls-files a "prefix" option > to add to each filename, and just pass in the submodule path. Then you > can let the sub-processes write directly to the common stdout, and I > think it would be safe to blindly pass the parent argv int

Re: [RFC/PATCH] ls-files: adding support for submodules

2016-09-09 Thread Jeff King
On Fri, Sep 09, 2016 at 02:53:24PM -0700, Brandon Williams wrote: > 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. > > Signed-off-by: Brandon Wil

[RFC/PATCH] ls-files: adding support for submodules

2016-09-09 Thread Brandon Williams
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. Signed-off-by: Brandon Williams --- Hey git developers! I'm new to the community and this is the firs