Re: [PATCH 5/7] grep: fix "--" rev/pathspec disambiguation

2017-02-14 Thread Brandon Williams
gt; > object = parse_object_or_die(sha1, arg); > if (!seen_dashdash) > @@ -1172,7 +1188,10 @@ int cmd_grep(int argc, const char **argv, const char > *prefix) > add_object_array_with_path(object, arg, , oc.mode, > oc.path); > } > > - /* Th

Re: [PATCH v3 00/27] Revamp the attribute system; another round

2017-02-09 Thread Brandon Williams
that we will need to update the callers again > anyway. > > Thanks. > At least v3 gets the attribute system to a state where further improvements should be relatively easy to make. And now as long as each thread has a unique attr_check structure, multiple callers can exist inside the attribute system at the same time. There is still more work to be done on it though. Still my biggest complaint is the "direction" aspect of the system. I would love to also eliminate that as global state at some point though I'm not sure how at this point. -- Brandon Williams

Re: [PATCH 12/15] unpack-trees: check if we can perform the operation for submodules

2017-02-16 Thread Brandon Williams
ou think it would makes sense to add in a call to 'submodule_free()' to clear the cache used to store the gitmodules config? -- Brandon Williams

Re: [PATCH 07/14] update submodules: introduce is_interesting_submodule

2017-02-15 Thread Brandon Williams
gt; + * for any kind of operation. > + */ > +extern int submodules_interesting_for_update(void); > +extern int is_interesting_submodule(const struct cache_entry *ce); > extern void check_for_new_submodule_commits(unsigned char new_sha1[20]); > extern int fetch_populated_submodules(const struct argv_array *options, > const char *prefix, int command_line_option, > -- > 2.12.0.rc0.16.gd1691994b4.dirty > -- Brandon Williams

Re: [PATCH 02/14] lib-submodule-update.sh: define tests for recursing into submodules

2017-02-15 Thread Brandon Williams
ubmodule_repo () { > git add sub1 && > git commit -m "Modify sub1" && > > + git checkout -b modify_sub1_recursively modify_sub1 && > + git -C sub1 checkout -b "add_nested_sub" && > + git -C sub1 submodule add --branch no_submodule ./. sub2 && I thought we were trying to avoid './.' when adding submodules? -- Brandon Williams

Re: [PATCH 25/27] attr: store attribute stacks in hashmap

2017-01-23 Thread Brandon Williams
On 01/18, Brandon Williams wrote: > On 01/13, Junio C Hamano wrote: > > Brandon Williams <bmw...@google.com> writes: > > > > > The last big hurdle towards a thread-safe API for the attribute system > > > is the reliance on a global attribute stack

Re: [PATCHv2 3/4] cache.h: document add_[file_]to_index

2017-01-18 Thread Brandon Williams
desired bit '(1<<2)' instead of '4', etc. Is there a preference for git as a whole? I know this is just a documentation change so maybe this isn't even the place to discuss this. -- Brandon Williams

Re: [PATCH v3 1/2] difftool: add a skeleton for the upcoming builtin

2017-01-18 Thread Brandon Williams
t's a pretty invasive change. > > -Peff Some other challenges would be how to address people setting environment variables like GIT_DIR that indicate the location of a repositories git directory, which wouldn't work if you have multiple repos open. I do agree that having a repo object of some sort would aid in simplifying submodule operations but may require too many invasive changes to basic low-level functions. -- Brandon Williams

Re: [PATCH] attr: mark a file-local symbol as static

2017-01-18 Thread Brandon Williams
he structure but there could be future callers who need that functionality. If you feel like they shouldn't be part of the api right now then I'm open to changing that for this series. Thanks! -- Brandon Williams

Re: [PATCH 21/27] attr: use hashmap for attribute dictionary

2017-01-18 Thread Brandon Williams
On 01/18, Stefan Beller wrote: > On Thu, Jan 12, 2017 at 3:53 PM, Brandon Williams <bmw...@google.com> wrote: > > > +/* Initialize an 'attr_hashmap' object */ > > +void attr_hashmap_init(struct attr_hashmap *map) > > In case a reroll is needed, mark this static

Re: [PATCH 25/27] attr: store attribute stacks in hashmap

2017-01-18 Thread Brandon Williams
On 01/13, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > The last big hurdle towards a thread-safe API for the attribute system > > is the reliance on a global attribute stack that is modified during each > > call into the attribute syst

Re: [PATCH 25/27] attr: store attribute stacks in hashmap

2017-01-18 Thread Brandon Williams
On 01/18, Stefan Beller wrote: > On Thu, Jan 12, 2017 at 3:53 PM, Brandon Williams <bmw...@google.com> wrote: > > -static void prepare_attr_stack(const char *path, int dirlen) > > +/* > > + * This funciton should only be called from 'get_attr_stack()', which

Re: [RFC 0/2] grep: make output consistent with revision syntax

2017-01-19 Thread Brandon Williams
f the object is a tree or a commit. Interestingly enough I don't think we have any tests that exist that test the formatting of grep's output when given a tree object since the test suite still passes with these changes in. Which means this fix should probably include a couple tests to ensure there's no regression in the future. -- Brandon Williams

Re: [RFC 2/2] grep: use '/' delimiter for paths

2017-01-19 Thread Brandon Williams
strbuf_addch(, strchr(name, ':') ? '/' : ':'); + char del = obj->type == OBJ_COMMIT ? ':' : '/'; + strbuf_addch(, del); } } init_tree_desc(, data, size); -- Brandon Williams

Re: [PATCH] strbuf: add strbuf_add_real_path()

2017-02-28 Thread Brandon Williams
On 02/27, René Scharfe wrote: > Am 27.02.2017 um 19:22 schrieb Brandon Williams: > >On 02/25, René Scharfe wrote: > >>+void strbuf_add_real_path(struct strbuf *sb, const char *path) > >>+{ > >>+ if (sb->len) { > >>+ struct strbuf resolve

Re: [PATCH] strbuf: add strbuf_add_real_path()

2017-02-27 Thread Brandon Williams
error > + * message if there is a problem. > + * > + * The directory part of `path` (i.e., everything up to the last > + * dir_sep) must denote a valid, existing directory, but the last > + * component need not exist. > + * > + * Callers that don't mind links should use the more lightweight > + * strbuf_add_absolute_path() instead. > + */ > +extern void strbuf_add_real_path(struct strbuf *sb, const char *path); > + > > /** > * Normalize in-place the path contained in the strbuf. See > -- > 2.12.0 > -- Brandon Williams

Re: [PATCH 10/10] submodule--helper clone: check for configured submodules using helper

2017-02-27 Thread Brandon Williams
On 02/23, Stefan Beller wrote: > On Thu, Feb 23, 2017 at 3:47 PM, Brandon Williams <bmw...@google.com> wrote: > > > @@ -795,14 +794,11 @@ static int prepare_to_clone_next_submodule(const > > struct cache_entry *ce, > > } > > > > /* > &

Re: [PATCH 0/5] recursing submodules with relative pathspec (grep and ls-files)

2017-02-27 Thread Brandon Williams
On 02/24, Brandon Williams wrote: > It was discovered that when using the --recurse-submodules flag with `git > grep` > and `git ls-files` and specifying a relative path when not at the root causes > the child processes spawned to error out with an error like: > > fatal: .

Re: [PATCH 1/5] grep: illustrate bug when recursing with relative pathspec

2017-02-27 Thread Brandon Williams
On 02/26, Duy Nguyen wrote: > On Sat, Feb 25, 2017 at 6:50 AM, Brandon Williams <bmw...@google.com> wrote: > > When using the --recurse-submodules flag with a relative pathspec which > > includes "..", an error is produced inside the child process spawned for

Re: [PATCH 05/10] submodule--helper: add is_active command

2017-02-27 Thread Brandon Williams
On 02/23, Stefan Beller wrote: > On Thu, Feb 23, 2017 at 3:47 PM, Brandon Williams <bmw...@google.com> wrote: > > There are a lot of places where an explicit check for > > submodule."".url is done to see if a submodule exists. In order > > to more easily facil

[PATCH] pathspec: removed unnecessary function prototypes

2016-09-13 Thread Brandon Williams
removed function prototypes from pathspec.h which don't have a corresponding implementation. Signed-off-by: Brandon Williams <bmw...@google.com> --- pathspec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/pathspec.h b/pathspec.h index 4a80f6f..59809e4 100644 --- a/pathspec.h

Re: [PATCH] pathspec: removed unnecessary function prototypes

2016-09-14 Thread Brandon Williams
On Wed, Sep 14, 2016 at 12:23 PM, Jeff King wrote: > On Tue, Sep 13, 2016 at 11:15:52AM -0700, Jeff King wrote: > I should have done a better job of not just providing the answer, but > showing how. The easiest tool here is "git log -S": > > git log -1 -p

[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

[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 <bmw...@google.com> --- Hey git developers! I'm new to the com

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

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

2016-09-12 Thread Brandon Williams
> static void write_name(const char *name) > { > /* > +* NEEDSWORK: To make this thread-safe, full_name would have to be > owned > +* by the caller. > +* > +* full_name get reused across output lines to minimize the allocation > +* churn. > +

[PATCH v2] ls-files: adding support for submodules

2016-09-12 Thread Brandon Williams
-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 11 +++- builtin/ls-files.c | 60 + t/t3007-ls-files-recurse-submodules.sh | 99 ++ 3 files changed, 169 insertions(+), 1 deletion(-)

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

Re: [PATCH 1/2] ls-files: optionally recurse into submodules

2016-09-23 Thread Brandon Williams
On Wed, Sep 21, 2016 at 11:20 PM, Jeff King wrote: >> +/** >> + * Recursively call ls-files on a submodule >> + */ >> +static void show_gitlink(const struct cache_entry *ce) >> +{ >> + struct child_process cp = CHILD_PROCESS_INIT; >> + int status; >> + >> +

[PATCH 2/3 v3] ls-files: optionally recurse into submodules

2016-09-23 Thread Brandon Williams
use to prepend to output or pathspec matching logic. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 7 ++- builtin/ls-files.c | 63 ++ t/t3007-ls-files-recurse-submodules.s

[PATCH 3/3 v3] ls-files: add pathspec matching for submodules

2016-09-23 Thread Brandon Williams
accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 134 -

[PATCH 1/3 v3] submodules: make submodule-prefix option an envvar

2016-09-23 Thread Brandon Williams
Add a submodule-prefix enviorment variable 'GIT_INTERNAL_SUBMODULE_PREFIX' which can be used by commands which have --recurse-submodule options. Signed-off-by: Brandon Williams <bmw...@google.com> --- cache.h | 1 + environment.c | 1 + 2 files changed, 2 insertions(+) diff

[PATCH 0/3] recursive support for ls-files

2016-09-23 Thread Brandon Williams
and instead have it being passed to a child process via an environment variable GIT_INTERNAL_SUBMODULE_PREFIX. This way we don't have to support anything to external users at the moment. Also fixed a bug (and added a test) for the -z options as pointed out by Jeff King. Brandon Williams (3): submodules

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

Re: [PATCH 0/3] recursive support for ls-files

2016-09-26 Thread Brandon Williams
On 09/26, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > In a previous email you mentioned that this feature should be completely > > hidden from users, which is why I removed the command line option for > > this latest series. >

Re: [PATCH 0/3] recursive support for ls-files

2016-09-26 Thread Brandon Williams
On 09/25, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > On 09/25, Jeff King wrote: > >> On Fri, Sep 23, 2016 at 05:13:31PM -0700, Brandon Williams wrote: > >> > >> > After looking at the feedback I rerolled a few thi

[PATCH 4/4 v4] ls-files: add pathspec matching for submodules

2016-09-26 Thread Brandon Williams
accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 28 ++--- dir.c

[PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-26 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, --stage, -v, -t, -z, --debug, --eol) Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 34 ++ t/t3007-ls-files-recurse-submodules.s

[PATCH 2/4 v4] ls-files: optionally recurse into submodules

2016-09-26 Thread Brandon Williams
to output or pathspec matching logic. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 7 +- builtin/ls-files.c | 143 - git.c | 2 +- t/t3007-ls-files-r

[PATCH 1/4 v4] submodules: make submodule-prefix option

2016-09-26 Thread Brandon Williams
-by: Brandon Williams <bmw...@google.com> --- Documentation/git.txt | 5 + cache.h | 1 + environment.c | 1 + git.c | 19 +++ 4 files changed, 26 insertions(+) diff --git a/Documentation/git.txt b/Documentation/git.txt index 7913fc2..d

[PATCH 0/4 v4] recursive support for ls-files

2016-09-26 Thread Brandon Williams
this series addresses some of issues brought up in v3 Brandon Williams (4): submodules: make submodule-prefix option ls-files: optionally recurse into submodules ls-files: pass through safe options for --recurse-submodules ls-files: add pathspec matching for submodules Documentation/git-ls

Re: [PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-28 Thread Brandon Williams
\-EOF > > ... > > EOF > > > > instead, perhaps? > > I actually think it would make more sense to add > > lf_to_nul () { > perl -pe 'y/\012/\000/' > } > > to t/test-lib-functions.sh somewhere near q_to_nul if we were to go > this route. Turns out this function already exists in test-lib-functions.sh -- Brandon Williams

Re: [PATCH v5 1/4] git: make super-prefix option

2016-09-29 Thread Brandon Williams
On 09/29, Jeff King wrote: > On Wed, Sep 28, 2016 at 02:50:40PM -0700, Brandon Williams wrote: > > > Add a super-prefix environment variable 'GIT_INTERNAL_SUPER_PREFIX' > > which can be used to specify a path from above a repository down to its > > root. The imme

[PATCH v6 2/4] ls-files: optionally recurse into submodules

2016-09-29 Thread Brandon Williams
to output or pathspec matching logic. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 8 +- builtin/ls-files.c | 138 - git.c | 2 +- t/t3007-ls-files-r

[PATCH v6 4/4] ls-files: add pathspec matching for submodules

2016-09-29 Thread Brandon Williams
accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 3 +- builtin/ls-files.c

[PATCH v6 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-29 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, --stage, -v, -t, -z, --debug, --eol) Other options are compiled into an argv_array but if an unsafe option is given the caller will be errored out. Signed-off-by: Brandon Williams <bmw...@google.com> --- buil

[PATCH v6 1/4] git: make super-prefix option

2016-09-29 Thread Brandon Williams
submodules about how they were invoked. This option is currently only allowed for builtins which support a super-prefix. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git.txt | 6 ++ cache.h | 2 ++ environment.c | 10 ++

[PATCH v7 2/4] ls-files: optionally recurse into submodules

2016-10-07 Thread Brandon Williams
to output or pathspec matching logic. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 8 +- builtin/ls-files.c | 138 - git.c | 2 +- t/t3007-ls-files-r

[PATCH v7 1/4] git: make super-prefix option

2016-10-07 Thread Brandon Williams
submodules about how they were invoked. This option is currently only allowed for builtins which support a super-prefix. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git.txt | 6 ++ cache.h | 2 ++ environment.c | 13 +

[PATCH v7 3/4] ls-files: pass through safe options for --recurse-submodules

2016-10-07 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, -v, -t, -z, --debug, --eol) Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 30 +++--- t/t3007-ls-files-recurse-submodules.s

[PATCH v7 4/4] ls-files: add pathspec matching for submodules

2016-10-07 Thread Brandon Williams
accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 3 +- builtin/ls-files.c

[PATCH v7 0/4] recursive support for ls-files

2016-10-07 Thread Brandon Williams
Few minor fixes pointed out Stefan Brandon Williams (4): git: make super-prefix option ls-files: optionally recurse into submodules ls-files: pass through safe options for --recurse-submodules ls-files: add pathspec matching for submodules Documentation/git-ls-files.txt | 7

Re: [PATCH v7 0/4] recursive support for ls-files

2016-10-07 Thread Brandon Williams
On 10/07, Stefan Beller wrote: > On Fri, Oct 7, 2016 at 11:34 AM, Stefan Beller <sbel...@google.com> wrote: > > On Fri, Oct 7, 2016 at 11:18 AM, Brandon Williams <bmw...@google.com> wrote: > >> Few minor fixes pointed out Stefan > > > > The serie

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

2016-09-20 Thread Brandon Williams
On Mon, Sep 19, 2016 at 4:21 PM, Junio C Hamano wrote: > > As the previous one that used a wrong (sorry) argument is not even > in 'next' yet, let's pretend that it never happened. It is OK to > still keep it and this patch as two separate steps, i.e. a topic > with two

Re: [PATCH 2/2] SQUASH??? Undecided

2016-09-15 Thread Brandon Williams
Yeah if that is the convention then I have no problem with the change. -Brandon On Thu, Sep 15, 2016 at 2:12 PM, Stefan Beller wrote: > + cc Brandon > > On Thu, Sep 15, 2016 at 1:51 PM, Junio C Hamano wrote: >> If we were to follow the convention to leave

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

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

2016-09-18 Thread Brandon Williams
On Fri, Sep 16, 2016 at 8:46 PM, Junio C Hamano wrote: > > As the previous one that used a wrong (sorry) argument is not even > in 'next' yet, let's pretend that it never happened. It is OK to > still keep it and this patch as two separate steps, i.e. a topic > with two

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

2016-09-16 Thread Brandon Williams
Pathspecs can be a bit tricky when trying to apply them to submodules. This change permits the pathspec logic to perform a prefix match against submodules since a pathspec could refer to a file inside of a submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/

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

2016-09-19 Thread Brandon Williams
On Mon, Sep 19, 2016 at 10:00 AM, Junio C Hamano wrote: > > I think you were clear enough. > > Don't read everything other people say in their reviews as pointing > out issues. Often trying to rephrase what they read in the code in > their own words is a good way to make sure

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

2016-09-19 Thread Brandon Williams
On Mon, Sep 19, 2016 at 11:04 AM, Junio C Hamano <gits...@pobox.com> wrote: > Brandon Williams <bmw...@google.com> writes: > >>> Again, what do we have in "name" and "item" at this point? If we >>> have a submodule at "sub/" and we

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

2016-09-19 Thread Brandon Williams
logic to perform a prefix match against submodules since a pathspec could refer to a file inside of a submodule. This can can result in false positive matches since a super module doesn't know what files could be in the submodule. Signed-off-by: Brandon Williams <bmw...@google.

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

2016-09-19 Thread Brandon Williams
I thought as much. Thanks for the quick explanation :) On Mon, Sep 19, 2016 at 11:34 AM, Junio C Hamano <gits...@pobox.com> wrote: > Brandon Williams <bmw...@google.com> writes: > >> side question if the answer is short: Any reason as to why all of the >> paths

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

2016-09-23 Thread Brandon Williams
> Yeah, a positive "I support this" flag would at least let us correctly > flag errors, which is the best we can do. That won't work for > non-builtins, but perhaps it is good enough in practice. > > -Peff So it sounds like we agree that this prefix option should be pushed to the top level. The

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

2016-09-21 Thread Brandon Williams
On Wed, Sep 21, 2016 at 3:53 PM, Junio C Hamano wrote: > > Sounds sensible. Just a minor nit in terminology, but I think we > fairly consistently say "a superproject contains submodules" (run > "git grep -E 'super *(module|project)'"). > > I'd suggest s/super

[PATCH 1/2] ls-files: optionally recurse into submodules

2016-09-21 Thread Brandon Williams
-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 11 +++- builtin/ls-files.c | 61 + t/t3007-ls-files-recurse-submodules.sh | 99 ++ 3 files changed, 170 insertions(+), 1 deletion(-) creat

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

2016-09-21 Thread Brandon Williams
accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 132 -

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

2016-09-21 Thread Brandon Williams
-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 11 +++- builtin/ls-files.c | 61 + t/t3007-ls-files-recurse-submodules.sh | 99 ++ 3 files changed, 170 insertions(+), 1 deletion(-) creat

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

2016-09-21 Thread Brandon Williams
accurate matching will be done once inside the submodule. This is due to the super module not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 132 -

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

2016-09-21 Thread Brandon Williams
This is another version of the first ls-files patch i sent out in order. In this version I fixed the option name to be '--submodule-prefix'.

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

2016-09-21 Thread Brandon Williams
yes you mentioned this and I meant to change that before sending it out. Looks like it slipped through have slipped through.

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

2016-09-20 Thread Brandon Williams
>>> + >>> + if (item->flags & PATHSPEC_ONESTAR) { >>> + return WM_MATCH; >>> + } else if (item->magic & PATHSPEC_GLOB) { >>> + return wildmatch(pattern, string, >>> + WM_PATHNAME | >>> + (item->magic &

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

2016-09-19 Thread Brandon Williams
side question if the answer is short: Any reason as to why all of the pathspec matching code lives inside of dir.c and not pathspec.c? On Mon, Sep 19, 2016 at 11:22 AM, Junio C Hamano <gits...@pobox.com> wrote: > Brandon Williams <bmw...@google.com> writes: > >> Yes in th

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

2016-09-27 Thread Brandon Williams
hem against the paths it finds in the index), it becomes clear that > giving both at the same time is awkward and not very useful. Well maybe...I don't really know much about how the prefix interacts in every scenario but would what you describe still work if we are in a sub dir of the superproject (which contains other directorys and perhaps a submodule) and execute a --recurse-submodules command in the subdirectory? I suspect we don't want to force users to be in the root directory of the project in order to use --recurse-submodules. -- Brandon Williams

[PATCH v5 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-28 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, --stage, -v, -t, -z, --debug, --eol) Other options are compiled into an argv_array but if an unsafe option is given the caller will be errored out. Signed-off-by: Brandon Williams <bmw...@google.com> --- buil

[PATCH v5 2/4] ls-files: optionally recurse into submodules

2016-09-28 Thread Brandon Williams
to output or pathspec matching logic. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-ls-files.txt | 7 +- builtin/ls-files.c | 139 - git.c | 2 +- t/t3007-ls-files-r

[PATCH v5 0/4] recursive support for ls-files

2016-09-28 Thread Brandon Williams
the compile_submodule_options function to compile all options that can be realistically passed through and when an option that isn't supported (or rather safe) yet is provided the caller will be errored out. Brandon Williams (4): git: make super-prefix option ls-files: optionally recurse into submodules ls

[PATCH v5 1/4] git: make super-prefix option

2016-09-28 Thread Brandon Williams
invoked. This option is currently only allowed for builtins which support a super-prefix. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git.txt | 6 ++ cache.h | 2 ++ environment.c | 10 ++ git.c

[PATCH v5 4/4] ls-files: add pathspec matching for submodules

2016-09-28 Thread Brandon Williams
accurate matching will be done once inside the submodule. This is due to the superproject not knowing what files could exist in the submodule. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-files.c | 28 ++--- dir.c

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

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > Well maybe...I don't really know much about how the prefix interacts in > > every scenario but would what you describe still work if we are in a sub > > dir of the superproject (w

Re: [PATCH v6 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-30 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, -v, -t, -z, --debug, --eol) If other unsafe options are given the caller will be errored out. Signed-off-by: Brandon Williams <bmw...@google.com> --- Something more like this correct? I ditched the extra para

Re: [PATCH v6 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-30 Thread Brandon Williams
On 09/29, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > +static void compile_submodule_options(const struct dir_struct *dir, int > > show_tag) > > +{ > > + if (line_terminator == '\0') > > + argv_array_

Re: [PATCH 0/3] recursive support for ls-files

2016-09-25 Thread Brandon Williams
On 09/25, Jeff King wrote: > On Fri, Sep 23, 2016 at 05:13:31PM -0700, Brandon Williams wrote: > > > After looking at the feedback I rerolled a few things, in particular the > > --submodule_prefix option that existed to give a submodule context about > > where >

Re: [PATCH] Documentation/fetch-options: emit recurse-submodules, jobs unconditionally

2016-09-26 Thread Brandon Williams
ing. Once we get something we agree on for adding the --submodule-prefix option to the top level we'll definitely have to update this section of code with the change. -- Brandon Williams

Re: [PATCH 1/4 v4] submodules: make submodule-prefix option

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > +--submodule-prefix=:: > > + Set a prefix which gives submodules context about the superproject that > > + invoked it. Only allowed for commands which support submodules. &

Re: [PATCH 2/4 v4] ls-files: optionally recurse into submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > +static const char *submodule_prefix; > > I would have expected this to added to environment.c in the previous > step, but it is OK--I'd imagine you'd grab this from the environmen

Re: [PATCH 4/4 v4] ls-files: add pathspec matching for submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > - /* Find common prefix for all pathspec's */ > > - max_prefix = common_prefix(); > > + /* > > +* Find common prefix for all pathspec's > > +* This i

Re: [PATCH 1/4 v4] submodules: make submodule-prefix option

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > >> s/submodules/submodule-prefix/ at least. > > > > So should the #define be SUPPORT_SUBMODULE_PREFIX instead? That may be > > too narrow minded and not looking toward futur

Re: [PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > if (recurse_submodules && > > - (show_stage || show_deleted || show_others || show_unmerged || > > + (show_deleted || show_others || show_unmerged || >

Re: [PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-27 Thread Brandon Williams
On 09/27, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > @@ -170,6 +171,27 @@ static void show_killed_files(struct dir_struct *dir) > > } > > } > > > > +/* > > + * Compile an argv_array with all of the o

Re: [PATCH 3/4 v4] ls-files: pass through safe options for --recurse-submodules

2016-09-27 Thread Brandon Williams
\-EOF > > ... > > EOF > > > > instead, perhaps? > > I actually think it would make more sense to add > > lf_to_nul () { > perl -pe 'y/\012/\000/' > } > > to t/test-lib-functions.sh somewhere near q_to_nul if we were to go > this route. my mind is drawing a blank, what does the 'lf' in 'lf_to_nul' stand for? line feed? -- Brandon Williams

[PATCH 4/5] grep: optionally recurse into submodules

2016-10-27 Thread Brandon Williams
-by: Brandon Williams <bmw...@google.com> --- Documentation/git-grep.txt | 5 + builtin/grep.c | 301 ++--- git.c | 2 +- t/t7814-grep-recurse-submodules.sh | 99 4 files changed, 386 inse

[PATCH 5/5] grep: enable recurse-submodules to work on objects

2016-10-27 Thread Brandon Williams
`git grep -e. -l --recurse-submodules HEAD` from: HEAD:file :sub/file to: HEAD:file HEAD:sub/file Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-grep.txt | 13 ++-- builtin/grep.c | 67 +++--- t/t781

[RFC PATCH 0/5] recursively grep across submodules

2016-10-27 Thread Brandon Williams
spend some more time thinking about this problem and will address it as an additional patch in the series at a later time. As for the rest of the series, it should be ready for review or comments. Brandon Williams (5): submodules: add helper functions to determine presence of subm

[PATCH 1/5] submodules: add helper functions to determine presence of submodules

2016-10-27 Thread Brandon Williams
Add two helper functions to submodules.c. `is_submodule_initialized()` checks if a submodule has been initialized at a given path and `is_submodule_checked_out()` check if a submodule has been checked out at a given path. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.

[PATCH 3/5] grep: add submodules as a grep source type

2016-10-27 Thread Brandon Williams
of the submodule to be grep'd). If the identifier is a SHA1 then we want to fall through to the `GREP_SOURCE_SHA1` case to handle the copying of the SHA1. Signed-off-by: Brandon Williams <bmw...@google.com> --- grep.c | 16 +++- grep.h | 1 + 2 files changed, 16 insertions(+), 1 de

[PATCH 2/5] submodules: load gitmodules file from commit sha1

2016-10-27 Thread Brandon Williams
teach submodules to load a '.gitmodules' file from a commit sha1. This enables the population of the submodule_cache to be based on the state of the '.gitmodules' file from a particular commit. Signed-off-by: Brandon Williams <bmw...@google.com> --- cache.h| 2 ++ co

Re: [PATCH 5/5] grep: enable recurse-submodules to work on objects

2016-10-28 Thread Brandon Williams
On 10/27, Brandon Williams wrote: > diff --git a/tree-walk.c b/tree-walk.c > index 828f4356b..b3f996174 100644 > --- a/tree-walk.c > +++ b/tree-walk.c > @@ -999,10 +999,11 @@ static enum interesting do_match(const struct > name_entry *entry, >

Re: [RFC PATCH 0/5] recursively grep across submodules

2016-10-28 Thread Brandon Williams
On 10/27, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > As for the rest of the series, it should be ready for review or comments. > > Just a few brief comments, before reading the patches carefully. > > * It is somewhat surpri

Re: [PATCH v4 2/2] transport: add protocol policy config option

2016-11-07 Thread Brandon Williams
er way. I'll add in another test for that, no reason not to test it. > > Squashable documentation suggestions are below. > Sounds good -- Brandon Williams

[PATCH v5 2/2] transport: add protocol policy config option

2016-11-07 Thread Brandon Williams
t;p...@peff.net> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/config.txt | 46 ++ Documentation/git.txt| 38 +--- git-submodule.sh | 12 ++-- t/lib-proto-disable.sh | 130 ++

<    1   2   3   4   5   6   7   8   9   10   >