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

2017-01-12 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attr.c b/attr.c index 1fcf042b8..04d24334e 100644 --- a/attr.c +++ b/attr.c @@ -402,8 +402,8

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

2017-01-12 Thread Brandon Williams
hes authored by Junio to address a couple of naming changes and to redistribute some code between patches so those patches would need a closer look. Thanks again to all the work Junio and Stefan put into this before I got a hold of it. Any comments are appreciated! Thanks, Brandon Williams Bran

[PATCH 12/27] Documentation: fix a typo

2017-01-12 Thread Brandon Williams
From: Stefan Beller Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- Documentation/gitattributes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 3173dee7e..a53d093ca 100644 --- a

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

2017-01-12 Thread Brandon Williams
ention the attr_stack global variable. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 71 +++--- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/attr.c b/at

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

2017-01-12 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commit.c b/commit.c index 2cf85158b..0c4ee3de4 100644 --- a/commit.c +++ b/commit.c @@ -415,8

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

2017-01-12 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 8026d68bd..50e5ee393 100644 --- a

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

2017-01-12 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 9bdf87a6f..17297fffe 100644 --- a/attr.c +++ b/attr.c @@ -469,7 +469,7

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

2017-01-12 Thread Brandon Williams
uot; with a direct return from there. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/attr.c b/attr.c index 17297fffe..e42f931b3 100644 --- a/attr.c +++ b/attr.

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

2017-01-12 Thread Brandon Williams
gọc Duy Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- Documentation/gitattributes.txt | 8 +--- attr.c | 15 +-- t/t0003-attributes.sh | 26 ++ 3 files chang

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

2017-01-12 Thread Brandon Williams
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 Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- archive.c

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

2017-01-12 Thread Brandon Williams
ng up. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/attr.c b/attr.c index f7cf7ae30..d180c7833 100644 --- a/attr.c +++ b/attr.c @@ -223,7 +223,7 @@ static s

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

2017-01-12 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/attr.c b/attr.c index 007f1a299..6b55a57ef 100644 --- a/attr.c +++ b/attr.c @@ -183,6 +183,12 @@ static const

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

2017-01-12 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 6b55a57ef..9bdf87a6f 100644 --- a/attr.c +++ b/attr.c @@ -300,7 +300,7

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

2017-01-12 Thread Brandon Williams
nio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/attr.c b/attr.c index 04d24334e..007f1a299 100644 --- a/attr.c +++ b/attr.c @@ -131,9 +131,8 @@ struct pattern { * If is_macro is tr

Re: [PATCHv3 2/2] builtin/commit.c: switch to xstrfmt(), instead of snprintf,

2017-01-13 Thread Brandon Williams
sha1_to_hex(oldsha1), sha1_to_hex(newsha1)); > + buf = xstrfmt("%s %s\n", sha1_to_hex(oldsha1), sha1_to_hex(newsha1)); > sigchain_push(SIGPIPE, SIG_IGN); > - write_in_full(proc.in, buf, n); > + write_in_full(proc.in, buf, strlen(buf)); > close(proc.in); > + free(buf); > sigchain_pop(SIGPIPE); > return finish_command(&proc); > } > -- > 2.11.0.154.g5f5f154 > -- 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 wrote: > > > +/* Initialize an 'attr_hashmap' object */ > > +void attr_hashmap_init(struct attr_hashmap *map) > > In case a reroll is needed, mark this static please. Will do. -- Brandon Williams

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 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 system. > > > >

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 wrote: > > -static void prepare_attr_stack(const char *path, int dirlen) > > +/* > > + * This funciton should only be called from 'get_attr_stack()', wh

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

2017-01-18 Thread Brandon Williams
besides the cwd. > But that'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
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: [PATCHv2 3/4] cache.h: document add_[file_]to_index

2017-01-18 Thread Brandon Williams
t;<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: [RFC 0/2] grep: make output consistent with revision syntax

2017-01-19 Thread Brandon Williams
x27;t based on if 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
mp; name[len - 1] != ':') { /* rev: or rev:path/ */ - strbuf_addch(&base, strchr(name, ':') ? '/' : ':'); + char del = obj->type == OBJ_COMMIT ? ':' : '/'; + strbuf_addch(&base, del); } } init_tree_desc(&tree, data, size); -- Brandon Williams

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

2017-01-20 Thread Brandon Williams
; +++ b/t/t7810-grep.sh > > @@ -1445,6 +1445,11 @@ test_expect_success 'grep outputs 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 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 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 >

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

2017-01-23 Thread Brandon Williams
nio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/attr.c b/attr.c index 04d24334e..007f1a299 100644 --- a/attr.c +++ b/attr.c @@ -131,9 +131,8 @@ struct pattern { * If is_macro is tr

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

2017-01-23 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commit.c b/commit.c index 2cf85158b..0c4ee3de4 100644 --- a/commit.c +++ b/commit.c @@ -415,8

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

2017-01-23 Thread Brandon Williams
uot; with a direct return from there. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/attr.c b/attr.c index 17297fffe..e42f931b3 100644 --- a/attr.c +++ b/attr.

[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 Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/attr.c b/attr.c index 007f1a299..6b55a57ef 100644 --- a/attr.c +++ b/attr.c @@ -183,6 +183,12 @@ static const

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

2017-01-23 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 6b55a57ef..9bdf87a6f 100644 --- a/attr.c +++ b/attr.c @@ -300,7 +300,7

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

2017-01-23 Thread Brandon Williams
gọc Duy Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- Documentation/gitattributes.txt | 8 +--- attr.c | 15 +-- t/t0003-attributes.sh | 26 ++ 3 files chang

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

2017-01-23 Thread Brandon Williams
From: Stefan Beller Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- Documentation/gitattributes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 3173dee7e..a53d093ca 100644 --- a

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

2017-01-23 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 8026d68bd..50e5ee393 100644 --- a

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

2017-01-23 Thread Brandon Williams
ng up. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/attr.c b/attr.c index f7cf7ae30..d180c7833 100644 --- a/attr.c +++ b/attr.c @@ -223,7 +223,7 @@ static s

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

2017-01-23 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attr.c b/attr.c index 1fcf042b8..04d24334e 100644 --- a/attr.c +++ b/attr.c @@ -402,8 +402,8

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

2017-01-23 Thread Brandon Williams
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
ention the attr_stack global variable. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 71 +++--- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/attr.c b/at

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

2017-01-23 Thread Brandon Williams
y spell out what the rules for a good attribute name are, etc. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/attr.c b/attr.c index

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

2017-01-23 Thread Brandon Williams
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 Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- archive.c

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

2017-01-23 Thread Brandon Williams
ance which is then used in the attribute collection process. This brings the attribute system one step closer to being thread-safe. Signed-off-by: Brandon Williams --- attr.c | 114 +++-- attr.h | 2 ++ 2 files changed, 78 insert

[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 --- 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 +++ b/attr.c @@ -209,7 +209,7

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

2017-01-23 Thread Brandon Williams
y the attribute stack only needs to be scanned a single time prior to attribute collection instead of each time a macro needs to be expanded. Signed-off-by: Brandon Williams --- attr.c | 69 ++ attr.h | 6 ++ 2 files changed, 3

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

2017-01-23 Thread Brandon Williams
d() to add attribute names one by one. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 38 - attr.h | 9 +++- builtin/check-attr.c | 60 ++-

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

2017-01-23 Thread Brandon Williams
essing the dictionary of interned attributes. Signed-off-by: Brandon Williams --- 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 index

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

2017-01-23 Thread Brandon Williams
From: Junio C Hamano It holds an interned string, and git_attr_name() is a way to peek into it. Make sure the involved pointer types are pointer-to-const. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 2 +- attr.h | 4 ++-- 2 files

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

2017-01-23 Thread Brandon Williams
From: Junio C Hamano 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 Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- Documentation/technical/api-gitattributes.txt | 86

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

2017-01-23 Thread Brandon Williams
names and initialize this structure. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 74 ++ attr.h | 17 +++ 2 files changed, 91 insertions(+) diff --git a/attr.

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

2017-01-23 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 9bdf87a6f..17297fffe 100644 --- a/attr.c +++ b/attr.c @@ -469,7 +469,7

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

2017-01-23 Thread Brandon Williams
uct with data that can be used in optimizing the query for the specific N attributes it contains. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- archive.c | 24 ++-- builtin/pack-objects.c | 19 +-- co

[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 --- attr.c | 33 +

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

2017-01-23 Thread Brandon Williams
he attribute system and should be handled with care. Signed-off-by: Brandon Williams --- 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

[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 William

[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

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 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 system. > > The same

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

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] submodule absorbing: fix worktree/gitdir pointers recursively for non-moves

2017-01-24 Thread Brandon Williams
e HEAD >expect.2 && > + git submodule absorbgitdirs && > + test -f sub1/.git && > + 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: [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 wrote: > > On 01/24, Stefan Beller wrote: > >> + if (read_gitfile_gently(old_git_dir, &err_code) || > >> + err_code == READ_GITFILE_ERR_NOT_A_REPO) { > >> +

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

2017-01-24 Thread Brandon Williams
ested git -C sub1/.git/modules/nested config \ > + core.worktree "../../../nested" && > + # make sure this re-setup is correct > + git status --ignore-submodules=none > +' > + > +test_expect_success 'absorb the git dir in a nested su

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 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 track of two structures ins

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 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 site, in a later it

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 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, > > &g

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

2017-01-25 Thread Brandon Williams
aybe we have to do that anyway once we > try to have submodules and worktrees working nicely together, but for now > just produce 'correct' (i.e. direct) pointers. > > Signed-off-by: Stefan Beller Looks good to me! -- Brandon Williams

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

2017-01-25 Thread Brandon Williams
27; ' > + test_config -C super submodule.submodule.update checkout && > (cd super && >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 1/2] abspath: add absolute_pathdup()

2017-01-26 Thread Brandon Williams
trib/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 00/27] Revamp the attribute system; another round

2017-01-27 Thread Brandon Williams
re series to allow pathspec code 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

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

2017-01-27 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commit.c b/commit.c index 2cf85158b..0c4ee3de4 100644 --- a/commit.c +++ b/commit.c @@ -415,8

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

2017-01-27 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attr.c b/attr.c index 1fcf042b8..04d24334e 100644 --- a/attr.c +++ b/attr.c @@ -402,8 +402,8

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

2017-01-27 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 6b55a57ef..9bdf87a6f 100644 --- a/attr.c +++ b/attr.c @@ -300,7 +300,7

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

2017-01-27 Thread Brandon Williams
ng up. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/attr.c b/attr.c index f7cf7ae30..d180c7833 100644 --- a/attr.c +++ b/attr.c @@ -223,7 +223,7 @@ static s

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

2017-01-27 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 9bdf87a6f..17297fffe 100644 --- a/attr.c +++ b/attr.c @@ -469,7 +469,7

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

2017-01-27 Thread Brandon Williams
From: Junio C Hamano It holds an interned string, and git_attr_name() is a way to peek into it. Make sure the involved pointer types are pointer-to-const. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 2 +- attr.h | 4 ++-- 2 files

[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 Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/attr.c b/attr.c index 007f1a299..6b55a57ef 100644 --- a/attr.c +++ b/attr.c @@ -183,6 +183,12 @@ static const

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

2017-01-27 Thread Brandon Williams
nio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/attr.c b/attr.c index 04d24334e..007f1a299 100644 --- a/attr.c +++ b/attr.c @@ -131,9 +131,8 @@ struct pattern { * If is_macro is tr

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

2017-01-27 Thread Brandon Williams
uot; with a direct return from there. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/attr.c b/attr.c index 17297fffe..e42f931b3 100644 --- a/attr.c +++ b/attr.

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

2017-01-27 Thread Brandon Williams
uct with data that can be used in optimizing the query for the specific N attributes it contains. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- archive.c | 24 ++-- builtin/pack-objects.c | 19 +-- co

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

2017-01-27 Thread Brandon Williams
From: Stefan Beller Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- Documentation/gitattributes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 3173dee7e..a53d093ca 100644 --- a

[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 --- attr.c | 33 +

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

2017-01-27 Thread Brandon Williams
names and initialize this structure. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 74 ++ attr.h | 17 +++ 2 files changed, 91 insertions(+) diff --git a/attr.

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

2017-01-27 Thread Brandon Williams
gọc Duy Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- Documentation/gitattributes.txt | 8 +--- attr.c | 15 +-- t/t0003-attributes.sh | 26 ++ 3 files chang

[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 --- 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/attr.c @@ -220,7 +220,7

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

2017-01-27 Thread Brandon Williams
he attribute system and should be handled with care. Signed-off-by: Brandon Williams --- 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

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

2017-01-27 Thread Brandon Williams
From: Junio C Hamano 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 Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- Documentation/technical/api-gitattributes.txt | 86

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

2017-01-27 Thread Brandon Williams
y spell out what the rules for a good attribute name are, etc. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/attr.c b/attr.c index

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

2017-01-27 Thread Brandon Williams
d() to add attribute names one by one. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 168 --- attr.h | 9 +-- builtin/check-attr.c | 60 +-

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

2017-01-27 Thread Brandon Williams
ance which is then used in the attribute collection process. This brings the attribute system one step closer to being thread-safe. Signed-off-by: Brandon Williams --- attr.c | 121 - attr.h | 5 +++ 2 files changed, 87 insert

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

2017-01-27 Thread Brandon Williams
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 8026d68bd..50e5ee393 100644 --- a

[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 William

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

2017-01-27 Thread Brandon Williams
ention the attr_stack global variable. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- attr.c | 71 +++--- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/attr.c b/at

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

2017-01-27 Thread Brandon Williams
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 Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- archive.c

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

2017-01-27 Thread Brandon Williams
y the attribute stack only needs to be scanned a single time prior to attribute collection instead of each time a macro needs to be expanded. Signed-off-by: Brandon Williams --- attr.c | 75 +- 1 file changed, 37 insertions(+), 38 del

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

2017-01-27 Thread Brandon Williams
essing the dictionary of interned attributes. Signed-off-by: Brandon Williams --- 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 index

[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

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: gitconfig get out of sync with submodule entries on branch switch

2017-01-30 Thread Brandon Williams
for each branch. Hopefully this gives 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

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

2017-01-30 Thread Brandon Williams
names and initialize this structure. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- This is the correct 15/27 patch that doesn't have the rebase mistake discovered by Stefan

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

2017-01-30 Thread Brandon Williams
d() to add attribute names one by one. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams --- This is the correct 16/27 patch that doesn't have the rebase mistake discoverd by Stefan. attr.c | 30 +-

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

2017-01-30 Thread Brandon Williams
aintainers you're all quite busy, 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
operator in the macro. 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

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: Cornelius Weig > > > >

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