[PATCH v4 0/6] recursively grep across submodules

2016-11-18 Thread Brandon Williams
itory. * always pass --threads=%d in order to limit threads to child proccess. 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 v4 2/6] submodules: load gitmodules file from commit sha1

2016-11-18 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 --- cache.h| 2 ++ con

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

2016-11-18 Thread Brandon Williams
he searching of history from a submodule's gitdir, rather than from a working directory. Signed-off-by: Brandon Williams --- builtin/grep.c | 20 +-- t/t7814-grep-recurse-submodules.sh | 41 ++ 2 files changed, 59 insertio

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

2016-11-18 Thread Brandon Williams
he command `git grep -e. -l --recurse-submodules HEAD` from: HEAD:file :sub/file to: HEAD:file HEAD:sub/file Signed-off-by: Brandon Williams --- Documentation/git-grep.txt | 13 +- builtin/grep.c | 83 +++--- t/t7814-gr

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

2016-11-18 Thread Brandon Williams
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 --- grep.c | 16 +++- grep.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --

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

2016-11-18 Thread Brandon Williams
ff-by: Brandon Williams --- Documentation/git-grep.txt | 5 + builtin/grep.c | 300 ++--- git.c | 2 +- t/t7814-grep-recurse-submodules.sh | 99 4 files changed, 385 insertions(+), 21 dele

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

2016-11-18 Thread Brandon Williams
On 11/18, Junio C Hamano wrote: > Brandon Williams writes: > > > @@ -671,12 +707,29 @@ static int grep_tree(struct grep_opt *opt, const > > struct pathspec *pathspec, > > enum interesting match = entry_not_interesting; > > struct name_entry entry; >

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

2016-11-18 Thread Brandon Williams
On 11/18, Junio C Hamano wrote: > Brandon Williams writes: > > > diff --git a/grep.h b/grep.h > > index 5856a23..267534c 100644 > > --- a/grep.h > > +++ b/grep.h > > @@ -161,6 +161,7 @@ struct grep_source { > > GREP_SOU

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

2016-11-18 Thread Brandon Williams
On 11/18, Junio C Hamano wrote: > Brandon Williams writes: > > > +static int grep_cache(struct grep_opt *opt, const struct pathspec > > *pathspec, > > + int cached) > > { > > int hit = 0; > > int nr; > > + struct strb

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

2016-11-21 Thread Brandon Williams
On 11/18, Brandon Williams wrote: > Also, in order to use the tree_entry_interesting code it looks like I'll > either have to pipe through a flag saying 'yes i want to match against > submodules' like I did for the other pathspec codepath. Either that or > a

Re: [PATCH 3/3] submodule--helper: add intern-git-dir function

2016-11-21 Thread Brandon Williams
entry' ' > + git init sub2 && > + test_commit -C sub2 first && > + git add sub2 && > + git commit -m superproject > +' > + > +test_expect_success 'intern the git dir fails for incomplete submodules' ' > + test_must_fail git submodule interngitdirs && > + # check that we did not break the repository: > + git status > +' > + > +test_done > + Could we add a test which has nested submodules that need to be migrated? Hopfully its just as easy as adding the test :) -- Brandon Williams

Re: [PATCHv2 3/3] submodule-config: clarify parsing of null_sha1 element

2016-11-21 Thread Brandon Williams
ule (e.g. consolidated values from local > git > configuration and the .gitmodules file in the worktree). > > For an example usage see test-submodule-config.c. > -- > 2.11.0.rc2.18.g0126045.dirty > -- Brandon Williams

Re: [PATCHv2 2/3] submodule-config: rename commit_sha1 to commit_or_tree

2016-11-21 Thread Brandon Williams
parameter.commit_sha1 = commit_sha1; > + // todo: get the actual tree here: s/todo/TODO Makes it more clear that this is a TODO -- Brandon Williams

Re: [PATCHv2 2/3] submodule-config: rename commit_sha1 to commit_or_tree

2016-11-21 Thread Brandon Williams
On 11/21, Stefan Beller wrote: > On Mon, Nov 21, 2016 at 4:11 PM, Brandon Williams wrote: > > On 11/21, Stefan Beller wrote: > >> > >> switch (lookup_type) { > >> @@ -448,7 +448,8 @@ static const struct submodule *config_from(struct > >> submod

Re: [PATCH v2 2/2] push: fix --dry-run to not push submodules

2016-11-22 Thread Brandon Williams
On 11/22, Junio C Hamano wrote: > Brandon Williams writes: > > > On 11/17, Stefan Beller wrote: > >> On Thu, Nov 17, 2016 at 10:46 AM, Brandon Williams > >> wrote: > >> > >> > sha1_array_clear(&commits)

Re: [PATCHv3 3/3] submodule-config: clarify parsing of null_sha1 element

2016-11-22 Thread Brandon Williams
local git > > configuration and the .gitmodules file in the worktree). > > > > For an example usage see test-submodule-config.c. I brought this up in v2, he must have just missed it for v3. -- Brandon Williams

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

2016-11-22 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 --- submodule.c | 38

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

2016-11-22 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 --- cache.h| 2 ++ con

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

2016-11-22 Thread Brandon Williams
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 --- grep.c | 16 +++- grep.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --

[PATCH v5 0/6] recursively grep across submodules

2016-11-22 Thread Brandon Williams
Major change in v5 is to use tree_is_interesting api instead of the vanilla pathspec code for submodules. This is to fix the issue in the last seires where I mix the two types. More tests were also added to ensure that the changes to the pathspec code functioned properly. Brandon Williams (6

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

2016-11-22 Thread Brandon Williams
he command `git grep -e. -l --recurse-submodules HEAD` from: HEAD:file :sub/file to: HEAD:file HEAD:sub/file Signed-off-by: Brandon Williams --- Documentation/git-grep.txt | 13 - builtin/grep.c | 76 --- t/t7814-grep-recurse-sub

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

2016-11-22 Thread Brandon Williams
ff-by: Brandon Williams --- Documentation/git-grep.txt | 5 + builtin/grep.c | 300 ++--- git.c | 2 +- t/t7814-grep-recurse-submodules.sh | 99 4 files changed, 386 insertions(+), 20 dele

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

2016-11-22 Thread Brandon Williams
he searching of history from a submodule's gitdir, rather than from a working directory. Signed-off-by: Brandon Williams --- builtin/grep.c | 20 +-- t/t7814-grep-recurse-submodules.sh | 41 ++ 2 files changed, 59 insertio

Re: [PATCHv4 0/3] submodule-config: clarify/cleanup docs and header

2016-11-22 Thread Brandon Williams
Series looks good to me. At least the issues I raised are fixed. -- Brandon Williams

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

2016-11-22 Thread Brandon Williams
On 11/22, Junio C Hamano wrote: > Brandon Williams writes: > > > diff --git a/tree-walk.c b/tree-walk.c > > index 828f435..ff77605 100644 > > --- a/tree-walk.c > > +++ b/tree-walk.c > > @@ -1004,6 +1004,19 @@ static enum interesting do_match

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

2016-11-22 Thread Brandon Williams
On 11/22, Brandon Williams wrote: > On 11/22, Junio C Hamano wrote: > > Brandon Williams writes: > > > > > diff --git a/tree-walk.c b/tree-walk.c > > > index 828f435..ff77605 100644 > > > --- a/tree-walk.c > > > +++ b/tree-walk.c > >

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

2016-11-22 Thread Brandon Williams
On 11/22, Junio C Hamano wrote: > Brandon Williams writes: > > >> > So this change may have an impact on "git ls-tree -r" with pathspec; > >> > I offhand do not know if that impact is undesirable or not. A test > >> > or two may be in

Re: [PATCH 31/35] pathspec: allow querying for attributes

2016-11-28 Thread Brandon Williams
if (!pathspec->items[i].attr_match_nr) > + continue; > + for (j = 0; j < pathspec->items[j].attr_match_nr; j++) This looks like a bug. Should it be: for (j = 0; j < pathspec->items[i].attr_match_nr; j++) where items[j] -> items[i] -- Brandon Williams

Re: [PATCH 31/35] pathspec: allow querying for attributes

2016-11-28 Thread Brandon Williams
> + die(_("Only one 'attr:' specification is allowed.")); > + > + argv_array_clear(&attrs); > + string_list_clear(&list, 0); > + return; > +} Unnecessary return statement, maybe you want to remove it? -- Brandon Williams

Re: [PATCH 31/35] pathspec: allow querying for attributes

2016-11-28 Thread Brandon Williams
want to add logic like this to the 'copy_pathspec' function so that when a pathspec struct is copied, the destination also has ownership of its own attribute items. -- Brandon Williams

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

2016-11-28 Thread Brandon Williams
n particular are you seeing issues with? I can't see any issues running it locally. -- Brandon Williams

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

2016-11-30 Thread Brandon Williams
> -Peff With you're stress script I'm able to see the failures. The interesting thing is that the entry missing is always from the non-submodule file. -- Brandon Williams

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

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 gr

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
t be workable 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
r/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: What's cooking in git.git (Nov 2016, #06; Mon, 28)

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

[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 --- submodule.c | 39

[PATCH v6 0/6] recursively grep across submodules

2016-11-30 Thread Brandon Williams
hreads trying to load thier files into a buffer 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

[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 --- cache.h| 2 ++ con

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

2016-11-30 Thread Brandon Williams
he command `git grep -e. -l --recurse-submodules HEAD` from: HEAD:file :sub/file to: HEAD:file HEAD:sub/file Signed-off-by: Brandon Williams --- Documentation/git-grep.txt | 13 - builtin/grep.c | 76 --- t/t7814-grep-recurse-sub

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

2016-11-30 Thread Brandon Williams
ff-by: Brandon Williams --- Documentation/git-grep.txt | 5 + builtin/grep.c | 300 ++--- git.c | 2 +- t/t7814-grep-recurse-submodules.sh | 99 4 files changed, 386 insertions(+), 20 dele

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

2016-11-30 Thread Brandon Williams
he searching of history from a submodule's gitdir, rather than from a working directory. Signed-off-by: Brandon Williams --- builtin/grep.c | 20 +-- t/t7814-grep-recurse-submodules.sh | 41 ++ 2 files changed, 59 insertio

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

2016-11-30 Thread Brandon Williams
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 --- grep.c | 16 +++- grep.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --

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 >

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 wi

Re: bw/transport-protocol-policy

2016-12-01 Thread Brandon Williams
est we bump > the minimum 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 1/6] submodules: add helper functions to determine presence of submodules

2016-12-01 Thread Brandon Williams
gt; think it was really 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

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: Bra

[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 --- http.c | 8 transport.c | 6 +++--- transport.h | 7 --- 3 files changed,

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

2016-12-01 Thread Brandon Williams
atch by Jeff King Signed-off-by: Brandon Williams --- Documentation/config.txt | 46 ++ Documentation/git.txt| 38 +--- git-submodule.sh | 12 ++-- t/lib-proto-disable.sh | 130 +-- t/t5509-

[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

[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 --- t/lib-proto-disable.sh | 12 ++-- 1 file changed, 6 insert

[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 --- http.c | 8 transport.c | 6 +++--- transport.h | 7 --- 3 files changed,

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 > --- > http.c | 8 >

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 th

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

2016-12-01 Thread Brandon Williams
er; > > which 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

[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

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

2016-12-01 Thread Brandon Williams
should 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 --- http.c | 8 transport.c | 8 +--- transport.h | 13 ++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --gi

[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: Bra

[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 --- t/lib-proto-disable.sh | 12 ++-- 1 file changed, 6 insert

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

2016-12-01 Thread Brandon Williams
atch by Jeff King Signed-off-by: Brandon Williams --- Documentation/config.txt | 46 ++ Documentation/git.txt| 38 +--- git-submodule.sh | 12 ++-- t/lib-proto-disable.sh | 130 +-- t/t5509-

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 safe for

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

2016-12-01 Thread Brandon Williams
y's server, then Alice will 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 5/6] http: treat http-alternates like redirects

2016-12-01 Thread Brandon Williams
llowed to be passed to curl? Is that because curl only understands those particular protocols? -- 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

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 quer

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 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 logic into a func

[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 --- t/lib-proto-disable.sh | 12 ++-- 1 file changed, 6 insert

[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: Bra

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

2016-12-01 Thread Brandon Williams
e provided which falls back to reading `GIT_PROTOCOL_FROM_USER` to determine if the protocol came from the user. Signed-off-by: Brandon Williams --- http.c | 12 ++-- transport.c | 8 +--- transport.h | 13 ++--- 3 files changed, 21 insertions(+), 12 deletions(-) di

[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
atch by Jeff King Signed-off-by: Brandon Williams --- Documentation/config.txt | 46 ++ Documentation/git.txt| 38 +--- git-submodule.sh | 12 ++-- t/lib-proto-disable.sh | 130 +-- t/t5509-

[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 --- http.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/http.c b/http.c index fee128b..a1c3a0e 100644 --- a/http.c +++ b/http.c

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

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

2016-12-02 Thread Brandon Williams
reason why real_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 wrote: > > On 12/01, Jeff King wrote: > >> On Thu, Dec 01, 2016 at 01:56:32PM -0800, Stefan Beller wrote: > >> > >> > > Bleh. Looks like it happens as part of the recentl

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

2016-12-02 Thread Brandon Williams
; 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 actually resolve > >> the issue. But I&#x

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

2016-12-02 Thread Brandon Williams
> featureful (at 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
aking real_path reentrant. Signed-off-by: Brandon Williams --- 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 +++ b/abspath.c @@

[PATCH] making real_path thread-safe

2016-12-05 Thread Brandon Williams
owing 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

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 17/17] checkout: add config option to recurse into submodules by default

2016-12-05 Thread Brandon Williams
--cached base && > + 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: [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 wrote: > > On 12/02, Stefan Beller wrote: > >> > >> test_expect_success '"checkout " honors diff.ignoreSubmodules' > >> ' > >> @@ -63,6 +70,2

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
e will be a bit more allocation churn with the smaller scope but multiple symlinks should be rare? Alternatively 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(&resolved); > > 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: [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 writes: > > > On 12/01, Junio C Hamano wrote: > >> Brandon Williams writes: > >> > >> > I started taking a look at your http redirect series (I really should > >> > have taking a lo

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 wrote: > > On 12/02, Stefan Beller wrote: > >> +test_expect_success 'option checkout.recurseSubmodules updates submodule' > >> ' > >> + test_config checkout.

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 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 needed to be resolved but

Re: "git add -p ." raises an unexpected "warning: empty strings as pathspecs will be made invalid in upcoming releases. please use . instead if you meant to match all paths"

2016-12-06 Thread Brandon Williams
d(int argc, const char **argv, const > > char *prefix, int patch) > > { > > struct pathspec pathspec; > > > > - parse_pathspec(&pathspec, 0, > > + parse_pathspec(&pathspec, 0, > >PATHSPEC_PREFER_FULL | > >PATHSPEC_SYMLINK_LEADING_PATH | > >PATHSPEC_PREFIX_ORIGIN, I've been doing a bit of work trying to clean up the pathspec initialization code and I believe this can be fixed without having to add in this work around. The code which does the munging is always trying to prefix the pathspec regardless if there is a prefix or not. If instead its changed to only try and prefix the original if there is indeed a prefix, then it should fix the munging. I'll try to get the series I'm working on out in the next day. -- Brandon Williams

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

2016-12-06 Thread Brandon Williams
pathspec elements as an intermediate step (with modificationed based on the passed in flags). This way the intermediate strings can then be freed prior to duplicating the result of parse_pathspec (which contains each of the elements with the prefix prepended). Signed-off-by: Brandon Williams --

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

2016-12-06 Thread Brandon Williams
Convert 'create_simplify()' to use the pathspec struct interface from using the '_raw' entry in the pathspec. Signed-off-by: Brandon Williams --- dir.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dir.c b/dir.c index bfa

[PATCH 00/17] pathspec cleanup

2016-12-06 Thread Brandon Williams
ode into their own helper functions. The overall result is a much more readable function. Brandon Williams (17): mv: convert to using pathspec struct interface dir: convert create_simplify to use the pathspec struct interface dir: convert fill_directory to use the pathspec struct interface ls-tre

[PATCH 03/17] dir: convert fill_directory to use the pathspec struct interface

2016-12-06 Thread Brandon Williams
Convert 'fill_directory()' to use the pathspec struct interface from using the '_raw' entry in the pathspec struct. Signed-off-by: Brandon Williams --- dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dir.c b/dir.c index 7df292b..8730a4f 100644 ---

[PATCH 06/17] pathspec: copy and free owned memory

2016-12-06 Thread Brandon Williams
ct, they need to be freed when clearing the pathspec struct (in 'clear_pathspec()') and duplicated when copying the pathspec struct (in 'copy_pathspec()'). Also change the type of 'match' and 'original' to 'char *' in order to more explicitly show the

[PATCH 10/17] pathspec: simpler logic to prefix original pathspec elements

2016-12-06 Thread Brandon Williams
more general situations. Also, slightly change the logic which decides when to prefix the original element in order to prevent a pathspec of "." from getting converted to "" (empty string). Signed-off-by: Brandon Williams --- pathspec.c | 33 +--

[PATCH 09/17] pathspec: always show mnemonic and name in unsupported_magic

2016-12-06 Thread Brandon Williams
more easily search the man pages for that magic type. This also avoids passing an extra parameter around the pathspec initialization code. Signed-off-by: Brandon Williams --- pathspec.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/pathspec.c b/pathspec.c

[PATCH 04/17] ls-tree: convert show_recursive to use the pathspec struct interface

2016-12-06 Thread Brandon Williams
Convert 'show_recursive()' to use the pathspec struct interface from using the '_raw' entry in the pathspec struct. Signed-off-by: Brandon Williams --- builtin/ls-tree.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/builtin/ls-tree.c b/bui

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