Re: [PATCH 8/8] pathspec: convert parse_pathspec to take an index

2017-05-11 Thread Junio C Hamano
Brandon Williams writes: > ... Note that if we go with the route to not pass > in an index now, it doesn't necessarily mean that down the line we won't > have to pass a 'repository' instance into parse_pathspec(). Correct. An attribute annotated pathspec may want to check if the attributes u

Re: [PATCH 8/8] pathspec: convert parse_pathspec to take an index

2017-05-11 Thread Brandon Williams
On 05/11, Junio C Hamano wrote: > Brandon Williams writes: > > > ls-files is the only command (that I know of) which does cache pruning > > based on the common prefix of all pathspecs given. If there is a > > submodule named 'sub' and you provided a pathspec 'sub/', the matching > > logic can ha

Re: [PATCH 8/8] pathspec: convert parse_pathspec to take an index

2017-05-10 Thread Junio C Hamano
Johannes Sixt writes: > Am 11.05.2017 um 03:48 schrieb Junio C Hamano: >> But perhaps you are right---it may be wrong for the contents of the >> current index (or any index) to affect how a pathspec element is >> parsed in the first place. If the current code (before this series) >> uses the_ind

Re: [PATCH 8/8] pathspec: convert parse_pathspec to take an index

2017-05-10 Thread Johannes Sixt
Am 11.05.2017 um 03:48 schrieb Junio C Hamano: But perhaps you are right---it may be wrong for the contents of the current index (or any index) to affect how a pathspec element is parsed in the first place. If the current code (before this series) uses the_index only for error checking, we may w

Re: [PATCH 8/8] pathspec: convert parse_pathspec to take an index

2017-05-10 Thread Junio C Hamano
Brandon Williams writes: > ls-files is the only command (that I know of) which does cache pruning > based on the common prefix of all pathspecs given. If there is a > submodule named 'sub' and you provided a pathspec 'sub/', the matching > logic can handle this but the cache pruning logic would

Re: [PATCH 8/8] pathspec: convert parse_pathspec to take an index

2017-05-10 Thread Brandon Williams
On 05/10, Junio C Hamano wrote: > Brandon Williams writes: > > > Convert 'parse_pathspec()' to take an index parameter. > > > > Since the index is only needed when the PATHSPEC_SUBMODULE_LEADING_PATH > > and PATHSPEC_STRIP_SUBMODULE_SLASH flags are given, add a check > > requiring a non-NULL inde

Re: [PATCH 8/8] pathspec: convert parse_pathspec to take an index

2017-05-09 Thread Junio C Hamano
Brandon Williams writes: > Convert 'parse_pathspec()' to take an index parameter. > > Since the index is only needed when the PATHSPEC_SUBMODULE_LEADING_PATH > and PATHSPEC_STRIP_SUBMODULE_SLASH flags are given, add a check > requiring a non-NULL index when either of these flags are given. > Conv

[PATCH 8/8] pathspec: convert parse_pathspec to take an index

2017-05-09 Thread Brandon Williams
Convert 'parse_pathspec()' to take an index parameter. Since the index is only needed when the PATHSPEC_SUBMODULE_LEADING_PATH and PATHSPEC_STRIP_SUBMODULE_SLASH flags are given, add a check requiring a non-NULL index when either of these flags are given. Convert callers which use these two flags