[PATCH v2 4/4] real_path: have callers use real_pathdup and strbuf_realpath

2016-12-08 Thread Brandon Williams
Migrate callers of real_path() who duplicate the retern value to use real_pathdup or strbuf_realpath. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/init-db.c | 6 +++--- environment.c | 2 +- setup.c | 15 +-- sha1_file.c | 2 +- submo

Re: [PATCH 16/17] pathspec: small readability changes

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams <bmw...@google.com> wrote: > > A few small changes to improve readability. This is done by grouping > > related > > assignments, adding blank lines, ensuring lines are <80 chara

Re: [PATCH 01/17] mv: convert to using pathspec struct interface

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams <bmw...@google.com> wrote: > > Convert the 'internal_copy_pathspec()' function to use the pathspec > > struct interface from using the deprecated 'get_pathspec()' interface. > > > >

Re: [PATCH 02/17] dir: convert create_simplify to use the pathspec struct interface

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams <bmw...@google.com> wrote: > > Convert 'create_simplify()' to use the pathspec struct interface from > > using the '_raw' entry in the pathspec. > > It would be even better to kill thi

Re: [PATCH v2 1/4] real_path: resolve symlinks by hand

2016-12-09 Thread Brandon Williams
On 12/09, Johannes Sixt wrote: > Am 09.12.2016 um 00:58 schrieb Brandon Williams: > >The current implementation of real_path uses chdir() in order to resolve > >symlinks. Unfortunately this isn't thread-safe as chdir() affects a > >process as a whole and not just an indivi

Re: [PATCH v2 0/4] road to reentrant real_path

2016-12-09 Thread Brandon Williams
On 12/09, Duy Nguyen wrote: > On Fri, Dec 9, 2016 at 6:58 AM, Brandon Williams <bmw...@google.com> wrote: > > diff --git a/setup.c b/setup.c > > index fe572b8..0d9fdd0 100644 > > --- a/setup.c > > +++ b/setup.c > > @@ -254,10 +254,12 @@ int get_common_dir_n

Re: [PATCH 14/16] pathspec: create strip submodule slash helpers

2016-12-09 Thread Brandon Williams
On 12/09, Stefan Beller wrote: > On Fri, Dec 9, 2016 at 11:18 AM, Brandon Williams <bmw...@google.com> wrote: > > Factor out the logic responsible for stripping the trailing slash on > > pathspecs referencing submodules into its own functi

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

2017-01-13 Thread Brandon Williams
f(buf, sizeof(buf), "%s %s\n", > - 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(); > } > -- > 2.11.0.154.g5f5f154 > -- Brandon Williams

[PATCH] index: improve constness for reading blob data

2017-01-10 Thread Brandon Williams
Improve constness of the index_state parameter to the 'read_blob_data_from_index' function. Signed-off-by: Brandon Williams <bmw...@google.com> --- cache.h | 2 +- read-cache.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cache.h b/cache.h index a50

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

2017-01-12 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 10/27] attr: support quoting pathname patterns in C style

2017-01-12 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 09/27] attr.c: plug small leak in parse_attr_line()

2017-01-12 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 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 <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 05/27] attr.c: complete a sentence in a comment

2017-01-12 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 14/27] attr: rename function and struct related to checking attributes

2017-01-12 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 06/27] attr.c: mark where #if DEBUG ends more clearly

2017-01-12 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 03/27] attr.c: update a stale comment on "struct match_attr"

2017-01-12 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 13/27] attr.c: outline the future plans by heavily commenting

2017-01-12 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 08/27] attr.c: tighten constness around "git_attr" structure

2017-01-12 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 02/27] attr.c: use strchrnul() to scan for one line

2017-01-12 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 00/27] Revamp the attribute system; another round

2017-01-12 Thread Brandon Williams
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 Brandon Williams (8

[PATCH 12/27] Documentation: fix a typo

2017-01-12 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 11/27] attr.c: add push_stack() helper

2017-01-12 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 01/27] commit.c: use strchrnul() to scan for one line

2017-01-12 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 23/27] attr: remove maybe-real, maybe-macro from git_attr

2017-01-12 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 18/27] attr: retire git_check_attrs() API

2017-01-12 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 19/27] attr: pass struct attr_check to collect_some_attrs

2017-01-12 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 17/27] attr: convert git_check_attrs() callers to use the new API

2017-01-12 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 15/27] attr: (re)introduce git_check_attr() and struct attr_check

2017-01-12 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 21/27] attr: use hashmap for attribute dictionary

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

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

2017-01-12 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 26/27] attr: push the bare repo check into read_attr()

2017-01-12 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 24/27] attr: tighten const correctness with git_attr and match_attr

2017-01-12 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 633a12cc3..90f576044 100644 --- a/attr.c

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

2017-01-12 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 cbb07d25d..f5cc68b67 100644 --- a/attr.c +++ b/attr.c @@ -521,26 +521,30 @@

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

2017-01-12 Thread Brandon Williams
the info stack frame it needs to be its own isolated frame and can simply be processed first to have the same affect of being at the top of the stack. Signed-off-by: Brandon Williams <bmw...@google.com> --- attr.c | 375 + 1 file chang

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

2017-01-12 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 16/27] attr: convert git_all_attrs() to use "struct attr_check"

2017-01-12 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 -

Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)

2016-11-30 Thread Brandon Williams
m able to see the failures. The interesting thing is that the entry missing is always from the non-submodule file. -- Brandon Williams

Re: bw/transport-protocol-policy

2016-12-01 Thread Brandon Williams
mum curl version there; there's a ton of #ifdef cruft going > back to 2002-era versions of libcurl). We should switch to warning all the time since this series adds in default whitelisted/blacklisted protocols anyways. -- Brandon Williams

Re: [PATCH v6 0/6] recursively grep across submodules

2016-12-01 Thread Brandon Williams
On 11/30, Jeff King wrote: > On Wed, Nov 30, 2016 at 05:28:28PM -0800, Brandon Williams wrote: > > > v6 fixes a race condition which existed in the 'is_submodule_populated' > > function. Instead of calling 'resolve_gitdir' to check for the existance > > of a > >

Re: bw/transport-protocol-policy

2016-12-01 Thread Brandon Williams
On 12/01, Jeff King wrote: > On Thu, Dec 01, 2016 at 11:35:24AM -0800, Brandon Williams wrote: > > > > I wouldn't expect anyone to ever set GIT_PROTOCOL_FROM_USER=1, but it > > > does behave in a funny way here, overriding the "redirect" flag. I think &

[PATCH v7 1/4] lib-proto-disable: variable name fix

2016-12-01 Thread Brandon Williams
The test_proto function assigns the positional parameters to named variables, but then still refers to "$desc" as "$1". Using $desc is more readable and less error-prone. Signed-off-by: Brandon Williams <bmw...@google.com> --- t/lib-proto-disable.sh | 12 +

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

2016-12-01 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 ++

[PATCH v7 4/4] transport: add from_user parameter to is_transport_allowed

2016-12-01 Thread Brandon Williams
be provided which falls back to reading `GIT_PROTOCOL_FROM_USER` to determine if the protocol came from the user. Signed-off-by: Brandon Williams <bmw...@google.com> --- http.c | 8 transport.c | 8 +--- transport.h | 13 ++--- 3 files changed, 19 insertions(+), 10 del

[PATCH v7 3/4] http: always warn if libcurl version is too old

2016-12-01 Thread Brandon Williams
Now that there are default "known-good" and "known-bad" protocols which are allowed/disallowed by 'is_transport_allowed' we should always warn the user that older versions of libcurl can't respect the allowed protocols for redirects. Signed-off-by: Brandon Williams <bmw...@

[PATCH v6 1/4] lib-proto-disable: variable name fix

2016-12-01 Thread Brandon Williams
The test_proto function assigns the positional parameters to named variables, but then still refers to "$desc" as "$1". Using $desc is more readable and less error-prone. Signed-off-by: Brandon Williams <bmw...@google.com> --- t/lib-proto-disable.sh | 12 +

[PATCH v7 0/4] transport protocol policy configuration

2016-12-01 Thread Brandon Williams
Changed the last patch in the series to use the parameter 'from_user' instead of 'redirect'. This allows us to use the same logic polarity and maintain use of the same vocabulary. Brandon Williams (4): lib-proto-disable: variable name fix transport: add protocol policy config option http

Re: [PATCH v6 4/4] transport: check if protocol can be used on a redirect

2016-12-01 Thread Brandon Williams
On 12/01, Brandon Williams wrote: > Add a the 'redirect' parameter to 'is_transport_allowed' which allows > callers to query if a transport protocol can be used on a redirect. > > Signed-off-by: Brandon Williams <bmw...@google.com> > --- > http.c | 8 +++

Re: [PATCH v6 4/4] transport: check if protocol can be used on a redirect

2016-12-01 Thread Brandon Williams
is pretty clear. Nobody would ever pass "1" as from_user to the > function, but it does the sensible thing if they do. > > -Peff > > [1] The original I posted calling it "redirect" was totally bogus > because the logic between the two names is inverted. -- Brandon Williams

Re: [PATCH v6 1/6] submodules: add helper functions to determine presence of submodules

2016-12-01 Thread Brandon Williams
planned out, and it obviously is inconsistent with > the other repo-discovery cases. But it is a convenient side effect for > submodules, and I doubt anybody is bothered by it in practice. > > -Peff I think this more robust check is probably a good idea, that way we don't step into a submodule with a .git directory that isn't really a .git dir. -- Brandon Williams

[PATCH v6 4/4] transport: check if protocol can be used on a redirect

2016-12-01 Thread Brandon Williams
Add a the 'redirect' parameter to 'is_transport_allowed' which allows callers to query if a transport protocol can be used on a redirect. Signed-off-by: Brandon Williams <bmw...@google.com> --- http.c | 8 transport.c | 6 +++--- transport.h | 7 --- 3 files chang

Re: bw/transport-protocol-policy

2016-12-01 Thread Brandon Williams
On 12/01, Jeff King wrote: > On Thu, Dec 01, 2016 at 10:14:15AM -0800, Brandon Williams wrote: > > > > 1. The new policy config lets you say "only allow this protocol when > > > the user specifies it". But when http.c calls is_transport_allowed(), > &g

[PATCH v6 3/4] http: always warn if libcurl version is too old

2016-12-01 Thread Brandon Williams
Now that there are default "known-good" and "known-bad" protocols which are allowed/disallowed by 'is_transport_allowed' we should always warn the user that older versions of libcurl can't respect the allowed protocols for redirects. Signed-off-by: Brandon Williams <bmw...@

[PATCH v6 4/4] transport: check if protocol can be used on a redirect

2016-12-01 Thread Brandon Williams
Add a the 'redirect' parameter to 'is_transport_allowed' which allows callers to query if a transport protocol can be used on a redirect. Signed-off-by: Brandon Williams <bmw...@google.com> --- http.c | 8 transport.c | 6 +++--- transport.h | 7 --- 3 files chang

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

2016-12-01 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 ++

[PATCH v6 0/4] transport protocol policy configuration

2016-12-01 Thread Brandon Williams
v6 introduces 2 additional patches which address problems with protocols that libcurl is allowed to use for redirection. Brandon Williams (4): lib-proto-disable: variable name fix transport: add protocol policy config option http: always warn if libcurl version is too old transport: check

Re: [PATCH v6 1/6] submodules: add helper functions to determine presence of submodules

2016-12-01 Thread Brandon Williams
On 12/01, Brandon Williams wrote: > On 12/01, Jeff King wrote: > > On Thu, Dec 01, 2016 at 10:46:23AM -0800, Junio C Hamano wrote: > > > > > > mkpath() is generally an unsafe function because it uses a static > > > > buffer, but it's handy and s

Re: [PATCH 2/6] http: always update the base URL for redirects

2016-12-01 Thread Brandon Williams
ll leak the > > existence of those sha1s to her. > --^^^ > ... to _him_ ? (again Mallory) > > ATB, > Ramsay Jones Depends, I only know Mallorys who are women so her seems appropriate. -- Brandon Williams

Re: [PATCH v7 4/4] transport: add from_user parameter to is_transport_allowed

2016-12-01 Thread Brandon Williams
On 12/01, Jeff King wrote: > On Thu, Dec 01, 2016 at 12:25:59PM -0800, Brandon Williams wrote: > > > Add the from_user parameter to the 'is_transport_allowed' function. > > This allows callers to query if a transport protocol is allowed, given > > that the caller knows tha

Re: [PATCH 5/6] http: treat http-alternates like redirects

2016-12-01 Thread Brandon Williams
d to be passed to curl? Is that because curl only understands those particular protocols? -- Brandon Williams

[PATCH v8 3/5] http: always warn if libcurl version is too old

2016-12-01 Thread Brandon Williams
Now that there are default "known-good" and "known-bad" protocols which are allowed/disallowed by 'is_transport_allowed' we should always warn the user that older versions of libcurl can't respect the allowed protocols for redirects. Signed-off-by: Brandon Williams <bmw...@

[PATCH v8 5/5] transport: add from_user parameter to is_transport_allowed

2016-12-01 Thread Brandon Williams
which falls back to reading `GIT_PROTOCOL_FROM_USER` to determine if the protocol came from the user. Signed-off-by: Brandon Williams <bmw...@google.com> --- http.c | 12 ++-- transport.c | 8 +--- transport.h | 13 ++--- 3 files changed, 21 insertions(+), 12 del

[PATCH v8 0/5] transport protocol policy configuration

2016-12-01 Thread Brandon Williams
v8 of this series moves the creation of an allowed protocol whitelist for CURLOPT_REDIR_PROTOCOLS to a helper function. This is to help out another series which depends on the creation of a whitelist for CURLOPT_PROTOCOLS. Brandon Williams (5): lib-proto-disable: variable name fix transport

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

2016-12-01 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 ++

[PATCH v8 4/5] http: create function to get curl allowed protocols

2016-12-01 Thread Brandon Williams
Move the creation of an allowed protocols whitelist to a helper function. Signed-off-by: Brandon Williams <bmw...@google.com> --- http.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/http.c b/http.c index fee128b..a1c3a0e 100644 --- a/

[PATCH v8 1/5] lib-proto-disable: variable name fix

2016-12-01 Thread Brandon Williams
The test_proto function assigns the positional parameters to named variables, but then still refers to "$desc" as "$1". Using $desc is more readable and less error-prone. Signed-off-by: Brandon Williams <bmw...@google.com> --- t/lib-proto-disable.sh | 12 +

Re: [PATCH v7 4/4] transport: add from_user parameter to is_transport_allowed

2016-12-01 Thread Brandon Williams
On 12/01, Brandon Williams wrote: > On 12/01, Jeff King wrote: > > On Thu, Dec 01, 2016 at 12:25:59PM -0800, Brandon Williams wrote: > > > > > Add the from_user parameter to the 'is_transport_allowed' function. > > > This allows callers to query if a tra

Re: [PATCH v7 4/4] transport: add from_user parameter to is_transport_allowed

2016-12-01 Thread Brandon Williams
On 12/01, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > I started taking a look at your http redirect series (I really should > > have taking a look at it sooner) and I see exactly what you're talking > > about. We can easily move this

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

2016-12-01 Thread Brandon Williams
On 12/01, Johannes Sixt wrote: > Am 01.12.2016 um 02:28 schrieb Brandon Williams: > >+git init "su:b" && > > Don't do that. Colons in file names won't work on Windows. > > -- Hannes > This test is needed to see if the code still works with file

Re: [PATCH v6 1/6] submodules: add helper functions to determine presence of submodules

2016-12-02 Thread Brandon Williams
the very least, it handles arbitrary-sized paths via > strbufs). I've actually been working on updating our implementation of realpath today. Its slow going but we'll see if it works when i'm done :) Also we can just drop in realpath since it requires that all path components are valid, while ours allows for the final component to be invalid. -- Brandon Williams

[PATCH] real_path: make real_path thread-safe

2016-12-05 Thread Brandon Williams
real_path reentrant. Signed-off-by: Brandon Williams <bmw...@google.com> --- abspath.c | 183 +- 1 file changed, 122 insertions(+), 61 deletions(-) diff --git a/abspath.c b/abspath.c index 2825de8..6f546e0 100644 --- a/abspath.c

[PATCH] making real_path thread-safe

2016-12-05 Thread Brandon Williams
threads: https://public-inbox.org/git/20161129010538.ga121...@google.com/ https://public-inbox.org/git/1480555714-186183-1-git-send-email-bmw...@google.com/ Brandon Williams (1): real_path: make real_path thread-safe abspath.c | 183

Re: [PATCH] real_path: make real_path thread-safe

2016-12-05 Thread Brandon Williams
> The long tail (i.e. the actual functionality) should actually be > faster, I'd imagine > as we do less than with using chdir. Depends on how expensive the chdir calls were. And I'm working to get rid of the static buffer. Just need have the callers own the memory first. -- Brandon Williams

Re: [PATCH] real_path: make real_path thread-safe

2016-12-05 Thread Brandon Williams
ively the 'next' buffer can be reused...I decided against that initially due to readability. And yes, lots of string manipulation requires lots of strbufs :) > > + //strbuf_release(); > > This is why the cover letter toned down expectations ? > (no // as comment, maybe remove that line?) yep. It will be added back in though once the callers to real_path take ownership of the memory. -- Brandon Williams

Re: [RFC PATCHv2 15/17] checkout: recurse into submodules if asked to

2016-12-05 Thread Brandon Williams
On 12/02, Stefan Beller wrote: > > test_expect_success '"checkout " honors diff.ignoreSubmodules' ' > @@ -63,6 +70,260 @@ test_expect_success '"checkout " honors > submodule.*.ignore from .git/ > ! test -s actual > ' Should you use test_must_fail and not '!'? -- Brandon Williams

Re: [RFC PATCHv2 15/17] checkout: recurse into submodules if asked to

2016-12-05 Thread Brandon Williams
On 12/05, Stefan Beller wrote: > On Mon, Dec 5, 2016 at 11:25 AM, Brandon Williams <bmw...@google.com> wrote: > > On 12/02, Stefan Beller wrote: > >> > >> test_expect_success '"checkout " honors diff.ignoreSubmodules' > >> ' > >>

Re: [RFC PATCHv2 17/17] checkout: add config option to recurse into submodules by default

2016-12-05 Thread Brandon Williams
&& > + git checkout advanced-base && > + git diff-files --quiet && > + git diff-index --quiet --cached advanced-base && > + git checkout --recurse-submodules base > +' > + This test doesn't look like it looks into the submodule to see if the submodule has indeed changed. Unless diff-index and diff-files recurse into the submodules? -- Brandon Williams

Re: [PATCH v7 4/4] transport: add from_user parameter to is_transport_allowed

2016-12-05 Thread Brandon Williams
On 12/05, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > I just took Jeff's series and applied it on top of mine (and fixed the > > small problem causing t5812 to fail) and then rebased it to v2.9.0. > > There were a few issues that nee

Re: [PATCH v7 4/4] transport: add from_user parameter to is_transport_allowed

2016-12-05 Thread Brandon Williams
On 12/05, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > On 12/01, Junio C Hamano wrote: > >> Brandon Williams <bmw...@google.com> writes: > >> > >> > I started taking a look at your http redirect series (I reall

Re: [RFC PATCHv2 17/17] checkout: add config option to recurse into submodules by default

2016-12-05 Thread Brandon Williams
On 12/05, Stefan Beller wrote: > On Mon, Dec 5, 2016 at 11:29 AM, Brandon Williams <bmw...@google.com> wrote: > > On 12/02, Stefan Beller wrote: > >> +test_expect_success 'option checkout.recurseSubmodules updates submodule' > >> ' > >> +

Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)

2016-11-30 Thread Brandon Williams
On 11/30, Brandon Williams wrote: > On 11/29, Jeff King wrote: > > On Tue, Nov 29, 2016 at 01:37:59AM -0500, Jeff King wrote: > > > > > 2. Grep threads doing more complicated stuff that needs to take a > > > lock. You might try building with -fsanitize=thr

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

2016-11-30 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

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

2016-11-30 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 | 76 --- t/t781

[PATCH v6 4/6] grep: optionally recurse into submodules

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

[PATCH v6 6/6] grep: search history of moved submodules

2016-11-30 Thread Brandon Williams
a submodule's gitdir, rather than from a working directory. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/grep.c | 20 +-- t/t7814-grep-recurse-submodules.sh | 41 ++ 2 files changed, 59 insertions(+), 2 del

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

2016-11-30 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_populated()` check if a submodule has been checked out at a given path. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.

[PATCH v6 0/6] recursively grep across submodules

2016-11-30 Thread Brandon Williams
in memory. Thanks to Stefan and Jeff for help debugging this problem. Brandon Williams (6): submodules: add helper functions to determine presence of submodules submodules: load gitmodules file from commit sha1 grep: add submodules as a grep source type grep: optionally recurse

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

2016-11-30 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

Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)

2016-11-30 Thread Brandon Williams
On 11/30, Jeff King wrote: > On Wed, Nov 30, 2016 at 06:32:04PM -0500, Jeff King wrote: > > > On Wed, Nov 30, 2016 at 03:28:23PM -0800, Brandon Williams wrote: > > > > > So I couldn't find a race condition in the code. I tracked the problem > > > to grep_so

Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)

2016-11-30 Thread Brandon Williams
ble manually. I think the chdir was > in the main thread. > > -Peff Yeah maybe we're missing something else... How did you run strace with your stress script? -- Brandon Williams

Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)

2016-11-30 Thread Brandon Williams
be an error with the submodule's .git file/directory then the child process will fail out. -- Brandon Williams

Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)

2016-11-30 Thread Brandon Williams
On 11/30, Jeff King wrote: > On Wed, Nov 30, 2016 at 03:42:48PM -0800, Brandon Williams wrote: > > > > where 20813 and 20867 are two threads of the main process. One is doing > > > the lstat and the other calls chdir at the same moment. > > > > Yeah so it l

Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)

2016-11-30 Thread Brandon Williams
ader/writer type of lock where many > "reader" threads can take the "I need to lstat()" lock simultaneously, > but block when an "I'm going to chdir()" writer holds it. > > -Peff Oh interesting, I wonder if there is a way to not have to perform a chdir since taking a lock to lstat wouldn't be ideal. Thanks for helping out with this! -- Brandon Williams

Re: [PATCH v7 4/4] transport: add from_user parameter to is_transport_allowed

2016-12-02 Thread Brandon Williams
On 12/01, Jeff King wrote: > On Thu, Dec 01, 2016 at 03:26:56PM -0800, Brandon Williams wrote: > > > > I started taking a look at your http redirect series (I really should > > > have taking a look at it sooner) and I see exactly what you're talking > > > abou

Re: [PATCH v6 1/6] submodules: add helper functions to determine presence of submodules

2016-12-02 Thread Brandon Williams
path() couldn't be re-implemented to avoid using chdir? I tried looking into the history of the function but couldn't find anything explaining why it was done that way. I assume it has to do with symlinks, but I thought there was a syscall (readlink?) that could do the resolution. -- Brandon Williams

Re: [PATCH v6 1/6] submodules: add helper functions to determine presence of submodules

2016-12-02 Thread Brandon Williams
On 12/02, Jacob Keller wrote: > On Fri, Dec 2, 2016 at 10:36 AM, Brandon Williams <bmw...@google.com> wrote: > > On 12/01, Jeff King wrote: > >> On Thu, Dec 01, 2016 at 01:56:32PM -0800, Stefan Beller wrote: > >> > >> > > Bleh. Loo

Re: [PATCH v6 1/6] submodules: add helper functions to determine presence of submodules

2016-12-02 Thread Brandon Williams
tion realpath() can't be used? > >>> From a cursory look at its man page it seems to do the symlink > >>> resolution. > >>> > >>> -- > >>> Brandon Williams > >> > >> I believe it uses the same method and thus wouldn't

Re: [PATCH v3 08/16] pathspec: always show mnemonic and name in unsupported_magic

2017-01-03 Thread Brandon Williams
On 01/03, Duy Nguyen wrote: > On Wed, Dec 14, 2016 at 6:14 AM, Brandon Williams <bmw...@google.com> wrote: > > @@ -340,8 +336,9 @@ static void NORETURN unsupported_magic(const char > > *pattern, > > continue; >

Re: What's cooking in git.git (Dec 2016, #08; Tue, 27)

2017-01-03 Thread Brandon Williams
On 01/03, Duy Nguyen wrote: > On Thu, Dec 29, 2016 at 5:06 PM, Duy Nguyen <pclo...@gmail.com> wrote: > > On Thu, Dec 29, 2016 at 1:18 AM, Brandon Williams <bmw...@google.com> wrote: > >> On 12/27, Junio C Hamano wrote: > >>> * bw/pathspec-cleanup (2016-1

[PATCH v4 10/16] pathspec: factor global magic into its own function

2017-01-03 Thread Brandon Williams
Create helper functions to read the global magic environment variables in additon to factoring out the global magic gathering logic into its own function. Signed-off-by: Brandon Williams <bmw...@google.com> --- pathspec.c | 127 +-

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