Re: [PATCH 2/2 v2] ls-files: add pathspec matching for submodules

2016-09-23 Thread Brandon Williams
On Fri, Sep 23, 2016 at 12:20 PM, Junio C Hamano wrote: > There is an interesting observation around this code. Note that it > is just something to keep in mind, even though I think we are in no > position to solve this within the scope of this series, or in fact I > am not sure if there is anyth

Re: [PATCH 2/2 v2] ls-files: add pathspec matching for submodules

2016-09-23 Thread Junio C Hamano
Brandon Williams writes: > static void show_ce_entry(const char *tag, const struct cache_entry *ce) > { > + struct strbuf name = STRBUF_INIT; > int len = max_prefix_len; > + if (submodule_prefix) > + strbuf_addstr(&name, submodule_prefix); > + strbuf_addstr(&name,

Re: [PATCH 2/2 v2] ls-files: add pathspec matching for submodules

2016-09-23 Thread Junio C Hamano
Brandon Williams writes: > - /* Find common prefix for all pathspec's */ > - max_prefix = common_prefix(&pathspec); > + /* > + * Find common prefix for all pathspec's > + * This is used as a performance optimization which unfortunately cannot > + * be done when recursin

[PATCH 2/2 v2] ls-files: add pathspec matching for submodules

2016-09-21 Thread Brandon Williams
Pathspecs can be a bit tricky when trying to apply them to submodules. The main challenge is that the pathspecs will be with respect to the superproject and not with respect to paths in the submodule. The approach this patch takes is to pass in the identical pathspec from the superproject to the s