Re: [PATCH] Documentation/install-webdoc.sh: quote a potentially unsafe shell expansion

2016-12-01 Thread Austin English
On Thu, Dec 1, 2016 at 2:42 PM, Junio C Hamano wrote: > Austin English writes: > >> diff --git a/Documentation/install-webdoc.sh >> b/Documentation/install-webdoc.sh >> index ed8b4ff..5fb2dc5 100755 >> --- a/Documentation/install-webdoc.sh >> +++

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

2016-12-01 Thread Ramsay Jones
On 02/12/16 00:18, Jeff King wrote: > On Fri, Dec 02, 2016 at 12:07:50AM +, Ramsay Jones wrote: > In a British context "Mallory and Irvine" were two (male) climbers who died on Everest in 1924 (tales of daring...), so it's easy to expect (from this side of the pond) that

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

2016-12-01 Thread Jeff King
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 > > about. We can easily move this logic into a function to make it easier > > to

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

2016-12-01 Thread Jeff King
On Fri, Dec 02, 2016 at 12:07:50AM +, Ramsay Jones wrote: > >> In a British context "Mallory and Irvine" were two (male) climbers who > >> died on Everest in 1924 (tales of daring...), so it's easy to expect > >> (from this side of the pond) that 'Mallory' would be male. However he > >> was

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

2016-12-01 Thread Ramsay Jones
On 01/12/16 23:43, Junio C Hamano wrote: > "Philip Oakley" writes: > >>> Depends, I only know Mallorys who are women so her seems appropriate. >>> >> In a British context "Mallory and Irvine" were two (male) climbers who >> died on Everest in 1924 (tales of daring...), so

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

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 03:02:23PM -0800, Brandon Williams wrote: > > diff --git a/http.c b/http.c > > index 825118481..051fe6e5a 100644 > > --- a/http.c > > +++ b/http.c > > @@ -745,6 +745,7 @@ static CURL *get_curl_handle(void) > > if (is_transport_allowed("ftps")) > >

[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

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

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

2016-12-01 Thread Brandon Williams
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 that the protocol is coming from the user (1) or not from the user (0) such as redirects in libcurl. If unknown a -1 should be provided

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

2016-12-01 Thread Brandon Williams
Previously the `GIT_ALLOW_PROTOCOL` environment variable was used to specify a whitelist of protocols to be used in clone/fetch/push commands. This patch introduces new configuration options for more fine-grained control for allowing/disallowing protocols. This also has the added benefit of

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

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 function to make

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

2016-12-01 Thread Junio C Hamano
"Philip Oakley" writes: >> Depends, I only know Mallorys who are women so her seems appropriate. >> > In a British context "Mallory and Irvine" were two (male) climbers who > died on Everest in 1924 (tales of daring...), so it's easy to expect > (from this side of the pond)

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread Junio C Hamano
René Scharfe writes: >> You can hack around it by passing a wrapper callback that flips the >> arguments. Since we have a "void *" data pointer, that would point to a >> struct holding the "real" callback and chaining to the original data >> pointer. >> >> It does incur the cost of

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

2016-12-01 Thread Junio C Hamano
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 function to make it easier > to generate the two whitelists.

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

2016-12-01 Thread Junio C Hamano
Johannes Schindelin writes: > The config kinda works now. But for what price. It stole 4 hours I did not > have. When the libexec/git-core/use-builtin-difftool solution took me a > grand total of half an hour to devise, implement and test. > > And you know what? I

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 transport protocol is allowed, given > > >

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

2016-12-01 Thread Philip Oakley
From: "Brandon Williams" On 12/01, Ramsay Jones wrote: On 01/12/16 09:04, Jeff King wrote: > If a malicious server redirects the initial ref > advertisement, it may be able to leak sha1s from other, > unrelated servers that the client has access to. For > example, imagine

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 that the protocol is coming

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

2016-12-01 Thread Brandon Williams
On 12/01, Jeff King wrote: > - set CURLOPT_PROTOCOLS alongside CURLOPT_REDIR_PROTOCOLS > restrict ourselves to a known-safe set and respect any > user-provided whitelist. > diff --git a/http.c b/http.c > index 825118481..051fe6e5a 100644 > --- a/http.c > +++ b/http.c > @@ -745,6

Re: EXT: Re: "Your branch is ahead of 'origin' by X commits"

2016-12-01 Thread Alfonsogonzalez, Ernesto (GE Digital)
Yes, it looks like I had a local branch “origin” which was behind by 108 commits. Setting upstream to the local branch correctly states "track local branch origin”. It was my mistake, there is no bug. Thanks, $ git rev-parse --symbolic-full-name origin refs/heads/origin # origin is a local

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

2016-12-01 Thread Brandon Williams
On 12/01, Ramsay Jones wrote: > > > On 01/12/16 09:04, Jeff King wrote: > > If a malicious server redirects the initial ref > > advertisement, it may be able to leak sha1s from other, > > unrelated servers that the client has access to. For > > example, imagine that Alice is a git user, she has

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread René Scharfe
Am 01.12.2016 um 21:19 schrieb Jeff King: On Thu, Dec 01, 2016 at 12:14:42PM -0800, Junio C Hamano wrote: Jeff King writes: To make matters more fun, apparently[1] there are multiple variants of qsort_r with different argument orders. _And_ apparently Microsoft defines

Re: [RFC/PATCH] add diff-pairs tool

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 02:22:47PM -0800, Junio C Hamano wrote: > Jeff King writes: > > >> It took me a while to dig it up because the topic is so old, but > >> > >> https://public-inbox.org/git/pine.lnx.4.58.0504251832480.18...@ppc970.osdl.org/ > >> > >> is the thread I had in

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

2016-12-01 Thread Junio C Hamano
Jeff King writes: > 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 that the protocol is

Re: EXT: Re: "Your branch is ahead of 'origin' by X commits"

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 10:03:33PM +, Alfonsogonzalez, Ernesto (GE Digital) wrote: > So I used branch ‹set-upstream and see the expected behavior. > > $ git branch --set-upstream-to=origin/master > Branch master set up to track remote branch master from origin. Ah, that makes sense. > I¹m

Re: [RFC/PATCH] add diff-pairs tool

2016-12-01 Thread Junio C Hamano
Jeff King writes: >> It took me a while to dig it up because the topic is so old, but >> >> https://public-inbox.org/git/pine.lnx.4.58.0504251832480.18...@ppc970.osdl.org/ >> >> is the thread I had in mind. The idea of rename detection followed >> soon afterwards. > > Thanks

Re: EXT: Re: "Your branch is ahead of 'origin' by X commits"

2016-12-01 Thread Junio C Hamano
"Alfonsogonzalez, Ernesto (GE Digital)" writes: > I'm still not sure what it means for the branch upstream to be 'origin' > only. If only you checked who the upstream of your 'master' was before doing the set-upstream-to, it would have been trivial to answer that

Re: EXT: Re: "Your branch is ahead of 'origin' by X commits"

2016-12-01 Thread Alfonsogonzalez, Ernesto (GE Digital)
Hi Jeff, I followed all your steps, but didn¹t find anything. $ ls -d .git .git $ ls .git/master ls: .git/master: No such file or directory $ git show HEAD commit 92d392c37e376db69d61dafdc427b379d860fb5a Merge: 6be322c 5544904 ... $ git show refs/heads/master commit

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

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 01:56:32PM -0800, Stefan Beller wrote: > > Bleh. Looks like it happens as part of the recently-added > > get_common_dir(). I'm not sure if that is ever relevant for submodules, > > but I guess in theory you could have a submodule clone that is part of a > > worktree? > >

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

2016-12-01 Thread Stefan Beller
On Thu, Dec 1, 2016 at 12:59 PM, Jeff King wrote: > On Thu, Dec 01, 2016 at 12:54:44PM -0800, Brandon Williams wrote: > >> > 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.

Re: "Your branch is ahead of 'origin' by X commits"

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 07:49:40PM +, Alfonsogonzalez, Ernesto (GE Digital) wrote: > $ git diff origin/master > $ git status > On branch master > Your branch is ahead of 'origin' by 108 commits. > (use "git push" to publish your local commits) > Untracked files: > (use "git add ..." to

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

2016-12-01 Thread Jeff King
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 that the protocol is coming from the user (1) or > not from the

Re: [RFC/PATCH] add diff-pairs tool

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 12:58:21PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > On Thu, Dec 01, 2016 at 12:52:05PM -0800, Junio C Hamano wrote: > > > >> Jeff King writes: > >> > >> > This takes the output of `diff-tree -z --raw` and feeds it > >> > back

"Your branch is ahead of 'origin' by X commits"

2016-12-01 Thread Alfonsogonzalez, Ernesto (GE Digital)
Hi, Git status tells me "Your branch is ahead of 'origin' by 108 commits.², but my local and origin/master are pointing to the same commit. What am I doing wrong? $ git diff origin/master $ git status On branch master Your branch is ahead of 'origin' by 108 commits. (use "git push" to publish

Re: [RFC/PATCH] add diff-pairs tool

2016-12-01 Thread Junio C Hamano
Junio C Hamano writes: > It took me a while to dig it up because the topic is so old, but > > https://public-inbox.org/git/pine.lnx.4.58.0504251832480.18...@ppc970.osdl.org/ > > is the thread I had in mind. The idea of rename detection followed > soon afterwards. ... which

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

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 12:54:44PM -0800, Brandon Williams wrote: > > 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. > > Looks like this is a no-go as well...the call to

Re: [RFC/PATCH] add diff-pairs tool

2016-12-01 Thread Junio C Hamano
Jeff King writes: > On Thu, Dec 01, 2016 at 12:52:05PM -0800, Junio C Hamano wrote: > >> Jeff King writes: >> >> > This takes the output of `diff-tree -z --raw` and feeds it >> > back to the later stages of the diff machinery to produce >> > diffs in other

Re: [RFC/PATCH] add diff-pairs tool

2016-12-01 Thread Junio C Hamano
Jeff King writes: > This takes the output of `diff-tree -z --raw` and feeds it > back to the later stages of the diff machinery to produce > diffs in other formats. A full circle. This reminds me of the experiment done more than 10 years ago at the beginning of the "diffcore

Re: [RFC/PATCH] add diff-pairs tool

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 12:52:05PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > This takes the output of `diff-tree -z --raw` and feeds it > > back to the later stages of the diff machinery to produce > > diffs in other formats. > > A full circle. This reminds me of

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 handing values to syscalls like > > > >

Re: [PATCH] Documentation/install-webdoc.sh: quote a potentially unsafe shell expansion

2016-12-01 Thread Junio C Hamano
Austin English writes: > diff --git a/Documentation/install-webdoc.sh b/Documentation/install-webdoc.sh > index ed8b4ff..5fb2dc5 100755 > --- a/Documentation/install-webdoc.sh > +++ b/Documentation/install-webdoc.sh > @@ -18,7 +18,7 @@ do > else >

[RFC/PATCH] add diff-pairs tool

2016-12-01 Thread Jeff King
This is a small tool I cooked up for splitting the tree-diff out from the generation of the patch text, and doing them in separate processes. It's a little more expensive than doing it all in one process (besides the process/pipe overhead, we may load blob content in the tree diff for rename

[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

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

2016-12-01 Thread Brandon Williams
Previously the `GIT_ALLOW_PROTOCOL` environment variable was used to specify a whitelist of protocols to be used in clone/fetch/push commands. This patch introduces new configuration options for more fine-grained control for allowing/disallowing protocols. This also has the added benefit of

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

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

2016-12-01 Thread Brandon Williams
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 that the protocol is coming from the user (1) or not from the user (0), such as redirects in libcurl. If unknown, a -1 should be

[PATCHv3 4/5] worktree: get worktrees from submodules

2016-12-01 Thread Stefan Beller
In a later patch we want to move around the the git directory of a submodule. Both submodules as well as worktrees are involved in placing git directories at unusual places, so their functionality may collide. To react appropriately to situations where worktrees in submodules are in use, offer a

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 12:22:37PM -0800, Junio C Hamano wrote: > Junio C Hamano writes: > > > Eh, wait. BSD and Microsoft have paramters reordered in the > > callback comparison function. I suspect that would not fly very > > well. > > Hmm. We could do it like this,

[PATCHv3 2/5] submodule helper: support super prefix

2016-12-01 Thread Stefan Beller
Just like main commands in Git, the submodule helper needs access to the superproject prefix. Enable this in the git.c but have its own fuse in the helper code by having a flag to turn on the super prefix. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano

[PATCHv3 3/5] test-lib-functions.sh: teach test_commit -C

2016-12-01 Thread Stefan Beller
Specifically when setting up submodule tests, it comes in handy if we can create commits in repositories that are not at the root of the tested trash dir. Add "-C " similar to gits -C parameter that will perform the operation in the given directory. Signed-off-by: Stefan Beller

[PATCHv3 1/5] submodule: use absolute path for computing relative path connecting

2016-12-01 Thread Stefan Beller
The current caller of connect_work_tree_and_git_dir passes an absolute path for the `git_dir` parameter. In the future patch we will also pass in relative path for `git_dir`. Extend the functionality of connect_work_tree_and_git_dir to take relative paths for parameters. We could work around this

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

[PATCHv3 5/5] submodule: add embed-git-dir function

2016-12-01 Thread Stefan Beller
When a submodule has its git dir inside the working dir, the submodule support for checkout that we plan to add in a later patch will fail. Add functionality to migrate the git directory to be embedded into the superprojects git directory. Signed-off-by: Stefan Beller

[PATCHv3 0/5] submodule embedgitdirs

2016-12-01 Thread Stefan Beller
v3: * have a slightly more generic function "relocate_gitdir". The recursion is strictly related to submodules, though. * bail out if a submodule is using worktrees. This also lays the groundwork for later doing the proper thing, as worktree.h offers a function

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread Junio C Hamano
Jeff King writes: > On Thu, Dec 01, 2016 at 12:14:42PM -0800, Junio C Hamano wrote: > >> Eh, wait. BSD and Microsoft have paramters reordered in the >> callback comparison function. I suspect that would not fly very >> well. > > You can hack around it by passing a wrapper

Re: [PATCH v2 1/1] convert: git cherry-pick -Xrenormalize did not work

2016-12-01 Thread Junio C Hamano
Jacob Keller writes: > On Wed, Nov 30, 2016 at 9:02 AM, wrote: >> From: Torsten Bögershausen >> diff --git a/convert.c b/convert.c >> index be91358..f8e4dfe 100644 >> --- a/convert.c >> +++ b/convert.c >> @@ -281,13 +281,13 @@ static int

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread Junio C Hamano
Junio C Hamano writes: > Eh, wait. BSD and Microsoft have paramters reordered in the > callback comparison function. I suspect that would not fly very > well. Hmm. We could do it like this, which may not be too bad. #if APPLE_QSORT_R struct apple_qsort_adapter {

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 12:14:42PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > To make matters more fun, apparently[1] there are multiple variants of > > qsort_r with different argument orders. _And_ apparently Microsoft > > defines qsort_s, but it's not quite the same

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread Junio C Hamano
Jeff King writes: > To make matters more fun, apparently[1] there are multiple variants of > qsort_r with different argument orders. _And_ apparently Microsoft > defines qsort_s, but it's not quite the same thing. But all of that can > be dealt with by having more specific flags

Re: [PATCH v2 1/1] convert: git cherry-pick -Xrenormalize did not work

2016-12-01 Thread Jacob Keller
On Wed, Nov 30, 2016 at 9:02 AM, wrote: > From: Torsten Bögershausen > diff --git a/convert.c b/convert.c > index be91358..f8e4dfe 100644 > --- a/convert.c > +++ b/convert.c > @@ -281,13 +281,13 @@ static int crlf_to_git(const char *path, const char > *src, size_t

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

2016-12-01 Thread Brandon Williams
On 12/01, Jeff King wrote: > On Thu, Dec 01, 2016 at 11:54:09AM -0800, Junio C Hamano wrote: > > > > I'm not sure if we should call this "redirect" here. That's how it's > > > used by the curl code, but I think from the perspective of the transport > > > whitelist, it is really "are you

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

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 11:54:09AM -0800, Junio C Hamano wrote: > > I'm not sure if we should call this "redirect" here. That's how it's > > used by the curl code, but I think from the perspective of the transport > > whitelist, it is really "are you overriding the from_user environment". > > > >

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

2016-12-01 Thread Junio C Hamano
Jeff King writes: > On Thu, Dec 01, 2016 at 11:44:07AM -0800, 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. > > s/a the/a/ > >> -int

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 > > > we'd want something more like: > > > >

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

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 11:44:07AM -0800, 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. s/a the/a/ > -int is_transport_allowed(const char *type) > +int

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 > transport.c | 6 +++--- >

[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, 11

Re: bw/transport-protocol-policy

2016-12-01 Thread Jeff King
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 > > we'd want something more like: > > > > if (redirect < 0) > > redirect

[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

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

[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, 11

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

2016-12-01 Thread Brandon Williams
Previously the `GIT_ALLOW_PROTOCOL` environment variable was used to specify a whitelist of protocols to be used in clone/fetch/push commands. This patch introduces new configuration options for more fine-grained control for allowing/disallowing protocols. This also has the added benefit of

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 05:26:43PM +0100, René Scharfe wrote: > The function qsort_s() was introduced with C11 Annex K; it provides the > ability to pass a context pointer to the comparison function, supports > the convention of using a NULL pointer for an empty array and performs a > few safety

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(), > > > the latter has no idea that we

Re: bw/transport-protocol-policy

2016-12-01 Thread Jeff King
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(), > > the latter has no idea that we are asking it about potential > >

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

2016-12-01 Thread Brandon Williams
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 handing values to syscalls like > > > this. > > > > I think your "unsafe" is not about

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

2016-12-01 Thread Jeff King
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 handing values to syscalls like > > this. > > I think your "unsafe" is not about thread-safety but about "the > caller

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

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 09:45:47AM -0800, Brandon Williams wrote: > Yeah I was trying to think through these scenarios myself last night. > And like you found it seemed alright to let the child process deal with > the .git file/dir as long as once actually exists at that path. If one > didn't

Re: Re* git pull --rebase should use fast forward merge if possible

2016-12-01 Thread Stefan Beller
On Thu, Dec 1, 2016 at 10:50 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Thu, Dec 1, 2016 at 9:59 AM, Junio C Hamano wrote: >> >>> +test_expect_success '--rebase fast forward' ' >>> + git reset --hard before-rebase &&

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

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 09:51:07AM -0800, Brandon Williams wrote: > 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

Re: Re* git pull --rebase should use fast forward merge if possible

2016-12-01 Thread Junio C Hamano
Stefan Beller writes: > On Thu, Dec 1, 2016 at 9:59 AM, Junio C Hamano wrote: > >> +test_expect_success '--rebase fast forward' ' >> + git reset --hard before-rebase && >> + git checkout -b ff && >> + echo another modification >file && >>

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 10:20:50AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > I don't have a preference on which direction we go, but yes, right now > > we are in an awkward middle ground. We should do one of: > > > > 1. Drop -Wno-format-zero-length from

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

2016-12-01 Thread Junio C Hamano
Brandon Williams writes: > 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

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

2016-12-01 Thread Junio C Hamano
Jeff King writes: > On Wed, Nov 30, 2016 at 05:28:29PM -0800, Brandon Williams wrote: > >> +/* >> + * Determine if a submodule has been populated at a given 'path' >> + */ >> +int is_submodule_populated(const char *path) >> +{ >> +int ret = 0; >> +struct stat st; >> +

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

2016-12-01 Thread Stefan Beller
On Wed, Nov 30, 2016 at 8:29 PM, Jeff King wrote: > On Wed, Nov 30, 2016 at 05:28:29PM -0800, Brandon Williams wrote: > >> +/* >> + * Determine if a submodule has been populated at a given 'path' >> + */ >> +int is_submodule_populated(const char *path) >> +{ >> + int ret = 0;

Re: [PATCH v2 1/1] convert: git cherry-pick -Xrenormalize did not work

2016-12-01 Thread Junio C Hamano
tbo...@web.de writes: > From: Torsten Bögershausen > > Working with a repo that used to be all CRLF. At some point it > was changed to all LF, with `text=auto` in .gitattributes. > Trying to cherry-pick a commit from before the switchover fails: > > $ git cherry-pick -Xrenormalize

Re: Re* git pull --rebase should use fast forward merge if possible

2016-12-01 Thread Stefan Beller
On Thu, Dec 1, 2016 at 9:59 AM, Junio C Hamano wrote: > +test_expect_success '--rebase fast forward' ' > + git reset --hard before-rebase && > + git checkout -b ff && > + echo another modification >file && > + git commit -m third file && > + > +

Re: bw/transport-protocol-policy

2016-12-01 Thread Brandon Williams
On 12/01, Jeff King wrote: > On Mon, Nov 28, 2016 at 04:15:08PM -0800, Junio C Hamano wrote: > > > * bw/transport-protocol-policy (2016-11-09) 2 commits > > (merged to 'next' on 2016-11-16 at 1391d3eeed) > > + transport: add protocol policy config option > > + lib-proto-disable: variable name

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-12-01 Thread Junio C Hamano
Jeff King writes: > I don't have a preference on which direction we go, but yes, right now > we are in an awkward middle ground. We should do one of: > > 1. Drop -Wno-format-zero-length from DEVELOPER_CFLAGS and make sure > future patches to do not violate it. > > 2.

Re* git pull --rebase should use fast forward merge if possible

2016-12-01 Thread Junio C Hamano
Junio C Hamano writes: > die_no_merge_candidates() would have triggered, I would imagine. > > Note that I won't be applying this without test updates and proper log > message, > so no need to worry about the style yet ;-) This time with a bit of explanation in the log and a

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 filenames that contain colons. Is there a way to

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 > > .git file/directory, use 'stat'.

Re: [ANNOUNCE] Git for Windows 2.11.0

2016-12-01 Thread Johannes Schindelin
Hi Stefan, On Thu, 1 Dec 2016, stefan.na...@atlas-elektronik.com wrote: > Am 01.12.2016 um 13:31 schrieb Johannes Schindelin: > > > * Support has been added to generate project files for Visual Studio > > 2010 and later. > > That's not really a new feature of Git-for-Windows, is it ? Yes

Re: [PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread René Scharfe
Am 01.12.2016 um 17:26 schrieb René Scharfe: > The function qsort_s() was introduced with C11 Annex K; it provides the > ability to pass a context pointer to the comparison function, supports > the convention of using a NULL pointer for an empty array and performs a > few safety checks. > > Add

[PATCH 3/3] string-list: use QSORT_S in string_list_sort()

2016-12-01 Thread René Scharfe
Pass the comparison function to cmp_items() via the context parameter of qsort_s() instead of using a global variable. That allows calling string_list_sort() from multiple parallel threads. Signed-off-by: Rene Scharfe --- string-list.c | 13 + 1 file changed, 5

[PATCH 2/3] add QSORT_S

2016-12-01 Thread René Scharfe
Add the macro QSORT_S, a convenient wrapper for qsort_s() that infers the size of the array elements and dies on error. Basically all possible errors are programming mistakes (passing NULL as base of a non-empty array, passing NULL as comparison function, out-of-bounds accesses), so terminating

[PATCH 1/3] compat: add qsort_s()

2016-12-01 Thread René Scharfe
The function qsort_s() was introduced with C11 Annex K; it provides the ability to pass a context pointer to the comparison function, supports the convention of using a NULL pointer for an empty array and performs a few safety checks. Add an implementation based on compat/qsort.c for platforms

  1   2   >