Fwd: [PATCH 1/2] doc: add doc for git-push --recurse-submodules=only

2017-02-02 Thread Brandon Williams
Looks good to me! Thanks for writing the documentation. I really need to be better about getting documentation done at the same time I'm adding features :) -Brandon On Wed, Feb 1, 2017 at 3:16 PM, Junio C Hamano wrote: > > cornelius.w...@tngtech.com writes: > > > From:

Re: [PATCH] dir: avoid allocation in fill_directory()

2017-02-08 Thread Brandon Williams
pend on prefix having a \0 at prefix_len then this will allow us to more easily find the bug and fix it. > > > > > /* Read the directory and prune it */ > > read_directory(dir, prefix, prefix_len, pathspec); > > > > - free(prefix); > > return prefix_len; > > } > -- > Duy -- Brandon Williams

Re: [PATCH 1/2] pathspec magic: add '^' as alias for '!'

2017-02-08 Thread Brandon Williams
: '!') And the user may scratch their head for a second since they didn't supply the '!' character, but rather '^'. That being said I think it should be fine since the long name of the magic is also printed so the user should be able to figure out what's wrong. I also don't think there are any users of pathspecs which disallow exclude magic so this may not even be an issue. -- Brandon Williams

Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-23 Thread Brandon Williams
On 01/23, 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 syste

[PATCH v2 04/27] attr.c: explain the lack of attr-name syntax check in parse_attr()

2017-01-23 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/attr.c

[PATCH v2 05/27] attr.c: complete a sentence in a comment

2017-01-23 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 10/27] attr: support quoting pathname patterns in C style

2017-01-23 Thread Brandon Williams
gọc Duy <pclo...@gmail.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/gitattributes.txt | 8 +--- attr.c | 15 +++

[PATCH v2 12/27] Documentation: fix a typo

2017-01-23 Thread Brandon Williams
From: Stefan Beller <sbel...@google.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/gitattributes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitattributes.t

[PATCH v2 13/27] attr.c: outline the future plans by heavily commenting

2017-01-23 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 40 +++- 1 file changed, 39 i

[PATCH v2 09/27] attr.c: plug small leak in parse_attr_line()

2017-01-23 Thread Brandon Williams
n NULL after cleaning up. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/attr.c

[PATCH v2 02/27] attr.c: use strchrnul() to scan for one line

2017-01-23 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v2 00/27] Revamp the attribute system; another round

2017-01-23 Thread Brandon Williams
as well as eliminates the potential for memory to grow unbounded. This is also more inline with the original vision of the attribute system refactor. Brandon Williams (8): attr: pass struct attr_check to collect_some_attrs attr: use hashmap for attribute dictionary attr: eliminate global

[PATCH v2 11/27] attr.c: add push_stack() helper

2017-01-23 Thread Brandon Williams
alves the number of times we mention the attr_stack global variable. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 71 +++-

[PATCH v2 20/27] attr: change validity check for attribute names to use positive logic

2017-01-23 Thread Brandon Williams
xactly spell out what the rules for a good attribute name are, etc. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 34 -- 1 fil

[PATCH v2 14/27] attr: rename function and struct related to checking attributes

2017-01-23 Thread Brandon Williams
tructure, in which these N elements are held, rename the type used for these individual array elements to "struct attr_check_item" and rename the function to "git_check_attrs()". Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.

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

2017-01-23 Thread Brandon Williams
the dictionary of interned attributes. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c| 173 +++--- attr.h| 2 + common-main.c | 3 + 3 files changed, 133 insertions(+), 45 deletions(-) diff --git a/attr.c b/attr.c

[PATCH v2 23/27] attr: remove maybe-real, maybe-macro from git_attr

2017-01-23 Thread Brandon Williams
time prior to attribute collection instead of each time a macro needs to be expanded. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 69 ++ attr.h | 6 ++ 2 files changed, 37 insertions(+), 38 deletions(-)

[PATCH v2 16/27] attr: convert git_all_attrs() to use "struct attr_check"

2017-01-23 Thread Brandon Williams
hen call attr_check_append() to add attribute names one by one. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 38 -

[PATCH v2 22/27] attr: eliminate global check_all_attr array

2017-01-23 Thread Brandon Williams
in the attribute collection process. This brings the attribute system one step closer to being thread-safe. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 114 +++-- attr.h | 2 ++ 2 files changed, 78 insertions(

[PATCH v2 24/27] attr: tighten const correctness with git_attr and match_attr

2017-01-23 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 14 +++--- attr.h | 2 +- builtin/check-attr.c | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/attr.c b/attr.c index ed9ba3756..95456503e 100644 --- a/attr.c

[PATCH v2 01/27] commit.c: use strchrnul() to scan for one line

2017-01-23 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --g

[PATCH v2 07/27] attr.c: simplify macroexpand_one()

2017-01-23 Thread Brandon Williams
o terminate" with a direct return from there. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-)

[PATCH v2 03/27] attr.c: update a stale comment on "struct match_attr"

2017-01-23 Thread Brandon Williams
the structure. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/attr.c b/attr.c index 04d24334e

[PATCH v2 27/27] attr: reformat git_attr_set_direction() function

2017-01-23 Thread Brandon Williams
-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 49 - attr.h | 3 ++- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/attr.c b/attr.c index c2ea5cb29..f35c1107f 100644 --- a/attr.c +++ b/attr.c @@ -578,26 +578,30 @@

[PATCH v2 26/27] attr: push the bare repo check into read_attr()

2017-01-23 Thread Brandon Williams
Push the bare repository check into the 'read_attr()' function. This avoids needing to have extra logic which creates an empty stack frame when inside a bare repo as a similar bit of logic already exists in the 'read_attr()' function. Signed-off-by: Brandon Williams <bmw...@google.

[PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-23 Thread Brandon Williams
instances. Due to the direction mechanism the stack needs to be dropped when the direction is switched. In order to ensure correctness when the direction is changed the attribute system needs to iterate through all active attr_check instances and drop each of their stacks. Signed-off-by: Brandon

[PATCH v2 19/27] attr: pass struct attr_check to collect_some_attrs

2017-01-23 Thread Brandon Williams
The old callchain used to take an array of attr_check_item items. Instead pass the 'attr_check' container object to 'collect_some_attrs()' and access the fields in the data structure directly. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.

Re: [PATCH 0/12] reducing resource usage of for_each_alternate_ref

2017-01-23 Thread Brandon Williams
> > Bugfixes and cleanups (the first one is actually a recent-ish > regression). Which is most likely my fault, Sorry! :) I think the old behavior was to die and not return NULL. -- Brandon Williams

Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-23 Thread Brandon Williams
On 01/23, Brandon Williams wrote: > As we discussed off-line I'll also do the rework to break up the > question and result. That way two threads can be executing using the > same attr_check structure. Thinking about this I don't really see what we would gain by breaking them up. Right

[PATCH v2 18/27] attr: retire git_check_attrs() API

2017-01-23 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Since nobody uses the old API, make it file-scope static, and update the documentation to describe the new API. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Bra

[PATCH v2 15/27] attr: (re)introduce git_check_attr() and struct attr_check

2017-01-23 Thread Brandon Williams
-terminated list of attribute names and initialize this structure. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 74 +

[PATCH v2 06/27] attr.c: mark where #if DEBUG ends more clearly

2017-01-23 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 17/27] attr: convert git_check_attrs() callers to use the new API

2017-01-23 Thread Brandon Williams
ct attr_check" struct with data that can be used in optimizing the query for the specific N attributes it contains. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@goo

[PATCH v2 08/27] attr.c: tighten constness around "git_attr" structure

2017-01-23 Thread Brandon Williams
com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 2 +- attr.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/attr.c b/attr.c index e42f931b3..f7cf7ae30 100644 --- a/attr.c +++ b/attr.c @@ -43,7 +43,7 @@ static int cannot_trust_maybe_real; stat

Re: [PATCH] submodule absorbing: fix worktree/gitdir pointers recursively for non-moves

2017-01-24 Thread Brandon Williams
t; + test -f sub1/nested/.git && > + test -d .git/modules/sub1/modules/nested && > + git status >actual.1 && > + git -C sub1/nested rev-parse HEAD >actual.2 && > + test_cmp expect.1 actual.1 && > + test_cmp expect.2 actual.2 > +' > + > test_expect_success 'setup a gitlink with missing .gitmodules entry' ' > git init sub2 && > test_commit -C sub2 first && > -- > 2.11.0.486.g67830dbe1c Aside from my one question the rest of this looks good to me. -- Brandon Williams

Re: [PATCHv3 3/3] submodule absorbing: fix worktree/gitdir pointers recursively for non-moves

2017-01-25 Thread Brandon Williams
have submodules and worktrees working nicely together, but for now > just produce 'correct' (i.e. direct) pointers. > > Signed-off-by: Stefan Beller <sbel...@google.com> Looks good to me! -- Brandon Williams

Re: PATCH 1/2] abspath: add absolute_pathdup()

2017-01-26 Thread Brandon Williams
b/contrib/coccinelle/xstrdup_or_null.cocci > index 3fceef132b..8e05d1ca4b 100644 > --- a/contrib/coccinelle/xstrdup_or_null.cocci > +++ b/contrib/coccinelle/xstrdup_or_null.cocci > @@ -5,3 +5,9 @@ expression V; > - if (E) > -V = xstrdup(E); > + V = xstrdup_or_null(E); > + > +@@ > +expression E; > +@@ > +- xstrdup(absolute_path(E)) > ++ absolute_pathdup(E) > -- > 2.11.0 > These two patches look good to me. -- Brandon Williams

[PATCH v3 16/27] attr: convert git_all_attrs() to use "struct attr_check"

2017-01-30 Thread Brandon Williams
hen call attr_check_append() to add attribute names one by one. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- This is the correct 16/27 patch that doesn't have the

[PATCH v3 15/27] attr: (re)introduce git_check_attr() and struct attr_check

2017-01-30 Thread Brandon Williams
-terminated list of attribute names and initialize this structure. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- This is the correct 15/27 patch that doesn't have the r

Re: gitconfig get out of sync with submodule entries on branch switch

2017-01-30 Thread Brandon Williams
ves you a bit more information to work with. Since Stefan has been working with this more recently than me he may have some more input. -- Brandon Williams

Re: [PATCH] Completion: Add support for --submodule=diff

2017-01-30 Thread Brandon Williams
sy, but I was wondering how > long it usually takes to get a response to patches? (also whether I'd > gotten some part of the submission process wrong?) > > Thanks, > Peter It looks like this must have just fallen through the cracks. Your patch looks good to me and works when I test it locally. -- Brandon Williams

Re: [PATCH 1/5] add SWAP macro

2017-01-30 Thread Brandon Williams
o. By disallow I mean place a comment at the definition to the macro and hopefully catch something like that in code-review. We have the same issue with the `ALLOC_GROW()` macro. -- Brandon Williams

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

2017-01-27 Thread Brandon Williams
de to call into the attribute system. Most of the changes in this revision are cosmetic (variable renames, code movement, etc) but there was a memory leak that was also fixed. Brandon Williams (8): attr: pass struct attr_check to collect_some_attrs attr: use hashmap for attribute diction

[PATCH v3 01/27] commit.c: use strchrnul() to scan for one line

2017-01-27 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --g

[PATCH v3 02/27] attr.c: use strchrnul() to scan for one line

2017-01-27 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v3 05/27] attr.c: complete a sentence in a comment

2017-01-27 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 09/27] attr.c: plug small leak in parse_attr_line()

2017-01-27 Thread Brandon Williams
n NULL after cleaning up. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/attr.c

[PATCH v3 13/27] attr.c: outline the future plans by heavily commenting

2017-01-27 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 40 +++- 1 file changed, 39 i

[PATCH v3 26/27] attr: push the bare repo check into read_attr()

2017-01-27 Thread Brandon Williams
Push the bare repository check into the 'read_attr()' function. This avoids needing to have extra logic which creates an empty stack frame when inside a bare repo as a similar bit of logic already exists in the 'read_attr()' function. Signed-off-by: Brandon Williams <bmw...@google.

[PATCH v3 11/27] attr.c: add push_stack() helper

2017-01-27 Thread Brandon Williams
alves the number of times we mention the attr_stack global variable. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 71 +++-

[PATCH v3 14/27] attr: rename function and struct related to checking attributes

2017-01-27 Thread Brandon Williams
tructure, in which these N elements are held, rename the type used for these individual array elements to "struct attr_check_item" and rename the function to "git_check_attrs()". Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.

[PATCH v3 23/27] attr: remove maybe-real, maybe-macro from git_attr

2017-01-27 Thread Brandon Williams
time prior to attribute collection instead of each time a macro needs to be expanded. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 75 +- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/at

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

2017-01-27 Thread Brandon Williams
the dictionary of interned attributes. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c| 173 +++--- attr.h| 2 + common-main.c | 3 + 3 files changed, 133 insertions(+), 45 deletions(-) diff --git a/attr.c b/attr.c

[PATCH v3 24/27] attr: tighten const correctness with git_attr and match_attr

2017-01-27 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 12 ++-- attr.h | 2 +- builtin/check-attr.c | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/attr.c b/attr.c index 8f4402ef3..69643ae77 100644 --- a/attr.c +++ b/

[PATCH v3 27/27] attr: reformat git_attr_set_direction() function

2017-01-27 Thread Brandon Williams
-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 49 - attr.h | 3 ++- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/attr.c b/attr.c index 62298ec2f..5493bff22 100644 --- a/attr.c +++ b/attr.c @@ -677,26 +677,30 @@

[PATCH v3 18/27] attr: retire git_check_attrs() API

2017-01-27 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Since nobody uses the old API, make it file-scope static, and update the documentation to describe the new API. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Bra

[PATCH v3 20/27] attr: change validity check for attribute names to use positive logic

2017-01-27 Thread Brandon Williams
xactly spell out what the rules for a good attribute name are, etc. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 34 -- 1 fil

[PATCH v3 16/27] attr: convert git_all_attrs() to use "struct attr_check"

2017-01-27 Thread Brandon Williams
hen call attr_check_append() to add attribute names one by one. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 168 +++

[PATCH v3 22/27] attr: eliminate global check_all_attr array

2017-01-27 Thread Brandon Williams
in the attribute collection process. This brings the attribute system one step closer to being thread-safe. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 121 - attr.h | 5 +++ 2 files changed, 87 insertions(

[PATCH v3 17/27] attr: convert git_check_attrs() callers to use the new API

2017-01-27 Thread Brandon Williams
ct attr_check" struct with data that can be used in optimizing the query for the specific N attributes it contains. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@goo

[PATCH v3 12/27] Documentation: fix a typo

2017-01-27 Thread Brandon Williams
From: Stefan Beller <sbel...@google.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/gitattributes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitattributes.t

[PATCH v3 19/27] attr: pass struct attr_check to collect_some_attrs

2017-01-27 Thread Brandon Williams
The old callchain used to take an array of attr_check_item items. Instead pass the 'attr_check' container object to 'collect_some_attrs()' and access the fields in the data structure directly. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.

[PATCH v3 25/27] attr: store attribute stack in attr_check structure

2017-01-27 Thread Brandon Williams
instances. Due to the direction mechanism the stack needs to be dropped when the direction is switched. In order to ensure correctness when the direction is changed the attribute system needs to iterate through all active attr_check instances and drop each of their stacks. Signed-off-by: Brandon

[PATCH v3 15/27] attr: (re)introduce git_check_attr() and struct attr_check

2017-01-27 Thread Brandon Williams
-terminated list of attribute names and initialize this structure. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 74 +

[PATCH v3 10/27] attr: support quoting pathname patterns in C style

2017-01-27 Thread Brandon Williams
gọc Duy <pclo...@gmail.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/gitattributes.txt | 8 +--- attr.c | 15 +++

[PATCH v3 06/27] attr.c: mark where #if DEBUG ends more clearly

2017-01-27 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 08/27] attr.c: tighten constness around "git_attr" structure

2017-01-27 Thread Brandon Williams
com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 2 +- attr.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/attr.c b/attr.c index e42f931b3..f7cf7ae30 100644 --- a/attr.c +++ b/attr.c @@ -43,7 +43,7 @@ static int cannot_trust_maybe_real; stat

[PATCH v3 04/27] attr.c: explain the lack of attr-name syntax check in parse_attr()

2017-01-27 Thread Brandon Williams
From: Junio C Hamano <gits...@pobox.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/attr.c

[PATCH v3 03/27] attr.c: update a stale comment on "struct match_attr"

2017-01-27 Thread Brandon Williams
the structure. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/attr.c b/attr.c index 04d24334e

[PATCH v3 07/27] attr.c: simplify macroexpand_one()

2017-01-27 Thread Brandon Williams
o terminate" with a direct return from there. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-)

Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-25 Thread Brandon Williams
On 01/25, Brandon Williams wrote: > On 01/25, Junio C Hamano wrote: > > Brandon Williams <bmw...@google.com> writes: > > > > >> In my mind, the value of having a constant check_attr is primarily > > >> that it gives us a stable pointer to serve

Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-25 Thread Brandon Williams
On 01/25, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > >> In my mind, the value of having a constant check_attr is primarily > >> that it gives us a stable pointer to serve as a hashmap key, > >> i.e. the identifier for each call

Re: [PATCHv2] submodule update: run custom update script for initial populating as well

2017-01-25 Thread Brandon Williams
per && >rm -rf submodule && >git submodule update submodule && > @@ -505,6 +519,7 @@ test_expect_success 'submodule update --merge - ignores > --merge for new submod > ' > > test_expect_success 'submodule update --rebase - ignores --rebase for new > submodules' ' > + test_config -C super submodule.submodule.update checkout && > (cd super && >rm -rf submodule && >git submodule update submodule && > -- > 2.11.0.495.g04f60290a0.dirty > -- Brandon Williams

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

2017-01-20 Thread Brandon Williams
utputs valid : > > for HEAD:t/' ' > > test_cmp expected actual > > ' > > > > +test_expect_success 'grep outputs valid : for HEAD:t' ' > > + git grep vvv HEAD:t >actual && > > + test_cmp expected actual > > +' > > + > > Perhaps you want an annotated tag object refs/tags/v1.0 that points > at the commit at the HEAD, and then run the same grep on v1.0:t, in > addition to the above test. > > > cat >expected < > HEAD:t/a/v:vvv > > HEAD:t/v:vvv -- Brandon Williams

Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-25 Thread Brandon Williams
On 01/23, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > ... It seems like breaking the question and answer up > > doesn't buy you much in terms of reducing allocation churn and instead > > complicates the API with needing to keep t

Re: [PATCH] submodule absorbing: fix worktree/gitdir pointers recursively for non-moves

2017-01-24 Thread Brandon Williams
On 01/24, Stefan Beller wrote: > On Tue, Jan 24, 2017 at 1:58 PM, Brandon Williams <bmw...@google.com> wrote: > > On 01/24, Stefan Beller wrote: > >> + if (read_gitfile_gently(old_git_dir, _code) || > >> + err_co

Re: [PATCHv2 3/3] submodule absorbing: fix worktree/gitdir pointers recursively for non-moves

2017-01-24 Thread Brandon Williams
one > +' > + > +test_expect_success 'absorb the git dir in a nested submodule' ' > + git status >expect.1 && > + git -C sub1/nested rev-parse HEAD >expect.2 && > + git submodule absorbgitdirs && > + test -f sub1/.git && >

Re: [PATCH v3 16/27] attr: convert git_all_attrs() to use "struct attr_check"

2017-01-28 Thread Brandon Williams
On 01/28, Stefan Beller wrote: > > This being moved down to below (being review churn) sounds like a > rebase mistake. ;) > Yep, thanks for catching that. I'll need to fix that up. -- Brandon Williams

Re: [PATCH] submodule.c: Add missing quotation marks

2017-02-17 Thread Brandon Williams
quot;could not run 'git status in submodule '%s'"), > + die(_("could not run 'git status' in submodule '%s'"), > path); > ret = -1; > } > -- > 2.11.1 > -- Brandon Williams

[PATCH 03/10] clone: add --submodule-spec= switch

2017-02-23 Thread Brandon Williams
with the pathspec. Based on a patch by Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-clone.txt | 23 ++- builtin/clone.c | 36 +-- t/t7400-submodule-ba

[PATCH 02/10] submodule update: add `--init-active` switch

2017-02-23 Thread Brandon Williams
by git submodule update --init --init-active This new switch allows users to record more complex patterns as it saves retyping them whenever you invoke update. Based on a patch by Stefan Beller <sbel...@google.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- Docum

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

2017-02-23 Thread Brandon Williams
Use the 'is_submodule_initialized()' helper to check for configured submodules instead of manually checking for the submodule's URL in the config. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 11 +++ 1 file changed, 3 insertions(+), 8 del

[PATCH 01/10] submodule: decouple url and submodule existence

2017-02-23 Thread Brandon Williams
fies which submodules should exist in the working tree. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/submodule.c b/submodule.c index 4c4f033e8..991066ddf 100644 --- a/s

[PATCH 09/10] submodule sync: use submodule--helper is-active

2017-02-23 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index 02b85dceb..f35345775 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1127,7 +1127,7 @@ cm

[PATCH 07/10] submodule status: use submodule--helper is-active

2017-02-23 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 4633a4336..f8adfb179 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1026,14 +1026,13 @@ cmd_

[PATCH 06/10] submodule add: respect submodule.active

2017-02-23 Thread Brandon Williams
When submodule.active is configured, in addition to adding submodule."".url to the config, add the path of the added submodule if it isn't already covered by the current config values. Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.sh | 1

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

2017-02-23 Thread Brandon Williams
is active or not. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c| 11 t/t7413-submodule-is-active.sh | 63 ++ 2 files changed, 74 insertions(+) create mode 100755 t/t7413-submodule-is-active.sh diff --git a/b

[PATCH 00/10] decoupling a submodule's existence and its url

2017-02-23 Thread Brandon Williams
submodule.active with a pathspec to use to check if a submodule is initialized. Brandon Williams (10): submodule: decouple url and submodule existence submodule update: add `--init-active` switch clone: add --submodule-spec= switch completion: clone can initialize specific submodules submodule--helper

[PATCH 04/10] completion: clone can initialize specific submodules

2017-02-23 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 6721ff80f..4e473aa90 100644 --- a/contrib/completi

[PATCH 08/10] submodule deinit: use most reliable url

2017-02-23 Thread Brandon Williams
The user could have configured the submodule to have a different URL from the one in the superproject's config. To account for this read what the submodule has configured for remote.origin.url and use that instead. Signed-off-by: Brandon Williams <bmw...@google.com> --- git-submodule.

[PATCH 4/5] ls-files: illustrate bug when recursing with relative pathspec

2017-02-24 Thread Brandon Williams
Since the child process luanched for the submodule has some context that it is operating underneath a superproject, this error could be avoided. Signed-off-by: Brandon Williams <bmw...@google.com> --- t/t3007-ls-files-recurse-submodules.sh | 50 ++ 1 fil

[PATCH 3/5] grep: fix bug when recuring with relative pathspec

2017-02-24 Thread Brandon Williams
Fix a bug which causes a child process for a submodule to error out when a relative pathspec with a ".." is provided in the superproject. While at it, correctly construct the super-prefix to be used in a submodule when not at the root of the repository. Signed-off-by: Brandon Wil

[PATCH 5/5] ls-files: fix bug when recuring with relative pathspec

2017-02-24 Thread Brandon Williams
Fix a bug which causes a child process for a submodule to error out when a relative pathspec with a ".." is provided in the superproject. While at it, correctly construct the super-prefix to be used in a submodule when not at the root of the repository. Signed-off-by: Brandon Wil

[PATCH 2/5] pathspec: add PATHSPEC_FROMROOT flag

2017-02-24 Thread Brandon Williams
-off-by: Brandon Williams <bmw...@google.com> --- pathspec.c | 2 +- pathspec.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pathspec.c b/pathspec.c index 7ababb315..ff622ba18 100644 --- a/pathspec.c +++ b/pathspec.c @@ -353,7 +353,7 @@ static void init_pathspec_item(

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

2017-02-24 Thread Brandon Williams
Since the child process luanched for the submodule has some context that it is operating underneath a superproject, this error could be avoided. Signed-off-by: Brandon Williams <bmw...@google.com> --- t/t7814-grep-recurse-submodules.sh | 42 ++ 1 file changed,

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

2017-02-24 Thread Brandon Williams
d an additional flag for the parse_pathspec() function in order to treat all paths provided as being from the root of the repository. I hesitantly selected the name 'PATHSPEC_FROMROOT' but I'm not fond of it since its too similar to the pathspec magic define 'PATHSPEC_FROMTOP'. So I'm open for naming s

Re: [PATCH 4/7] grep: re-order rev-parsing loop

2017-02-14 Thread Brandon Williams
if (get_sha1_with_context(arg, 0, sha1, )) > + break; > + > + object = parse_object_or_die(sha1, arg); > + if (!seen_dashdash) > + verify_non_filename(prefix, arg); > + add_object_array_with_path(object, arg, , oc.mod

Re: [PATCH 1/7] grep: move thread initialization a little lower

2017-02-14 Thread Brandon Williams
> bump it quite a bit lower (to right before we actually start > grepping), but I doubt it matters much in practice. Looks good. And yes I don't believe anything needs the thread initialization to happen earlier. -- Brandon Williams

Re: [RFC-PATCHv2] submodules: add a background story

2017-02-13 Thread Brandon Williams
ule in the .gitmodules file, isn't it already initialized then? Maybe this state would be better named "(in)active" as a module that is interesting to a user is "active"? -- Brandon Williams

Re: [PATCH 2/2] ls-files: move only kept cache entries in prune_cache()

2017-02-10 Thread Brandon Williams
e + pos, > + (last - pos) * sizeof(struct cache_entry *)); > + active_nr = last - pos; > } > > /* > -- > 2.11.1 > Both these patches look good to me. -- Brandon Williams

  1   2   3   4   5   6   7   8   9   10   >