Re: [PATCH v7 1/9] connect: document why we sometimes call get_port after get_host_and_port

2016-05-25 Thread Mike Hommey
On Tue, May 24, 2016 at 06:44:26AM +0200, Torsten Bögershausen wrote: > On 05/23/2016 11:30 PM, Junio C Hamano wrote: > > Torsten Bögershausen writes: > > > > > > > > get_host_and_port(_host, ); > > > > > >+/* get_host_and_port may

Re: [PATCH v7 1/9] connect: document why we sometimes call get_port after get_host_and_port

2016-05-23 Thread Mike Hommey
On Mon, May 23, 2016 at 02:30:57PM -0700, Junio C Hamano wrote: > Torsten Bögershausen writes: > > get_host_and_port(_host, ); > + /* get_host_and_port may not return a port > even when > +

Re: [PATCH v7 1/9] connect: document why we sometimes call get_port after get_host_and_port

2016-05-22 Thread Mike Hommey
On Sun, May 22, 2016 at 08:07:05AM +0200, Torsten Bögershausen wrote: > On 22.05.16 01:17, Mike Hommey wrote: > > Signed-off-by: Mike Hommey <m...@glandium.org> > > --- > > connect.c | 6 ++ > > 1 file changed, 6 insertions(+) > > > > diff --

[PATCH v7 3/9] connect: re-derive a host:port string from the separate host and port variables

2016-05-21 Thread Mike Hommey
-derive one from the host and port variables. This will allow to refactor parse_connect_url() to return separate host and port strings. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 31 +++ 1 file changed, 23 insertions(+), 8 deletions(-) diff

[PATCH v7 5/9] connect: group CONNECT_DIAG_URL handling code

2016-05-21 Thread Mike Hommey
Previous changes made both branches handling CONNECT_DIAG_URL identical. We can now remove one of those branches and have CONNECT_DIAG_URL be handled in one place. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 16 +--- 1 file changed, 1 insertion(+), 15 del

[PATCH v7 7/9] connect: change the --diag-url output to separate user and host

2016-05-21 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 6 ++ t/t5500-fetch-pack.sh | 14 -- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/connect.c b/connect.c index 48d9cd2..52d34c7 100644 --- a/connect.c +++ b/connect.c @@ -710,10

[PATCH v7 2/9] connect: call get_host_and_port() earlier

2016-05-21 Thread Mike Hommey
however preserve hostandport, at least for now. Note that in git_tcp_connect_sock, the port was set to "" in a case that never can happen, so that code path was removed. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 47 +++

[PATCH v7 4/9] connect: make parse_connect_url() return separated host and port

2016-05-21 Thread Mike Hommey
the "user@" part of the host, in order to pick the port properly. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 43 +-- t/t5500-fetch-pack.sh | 32 +--- 2 files changed, 46 insertions

[PATCH v7 9/9] connect: move ssh command line preparation to a separate function

2016-05-21 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 108 +- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/connect.c b/connect.c index 04ce210..ddfda4e 100644 --- a/connect.c +++ b/connect.c @@ -680,6 +

[PATCH v7 8/9] connect: actively reject git:// urls with a user part

2016-05-21 Thread Mike Hommey
Currently, urls of the for git://user@host don't work because user@host is not resolving at the DNS level, but we shouldn't be relying on it being an invalid host name, and actively reject it for containing a username in the first place. Signed-off-by: Mike Hommey <m...@glandium.

[PATCH v7 6/9] connect: make parse_connect_url() return the user part of the url as a separate value

2016-05-21 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 51 ++- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/connect.c b/connect.c index c0fad4f..48d9cd2 100644 --- a/connect.c +++ b/connect.c @@ -588,11 +588,13 @@

[PATCH v7 0/9] connect: various cleanups

2016-05-21 Thread Mike Hommey
Difference with v6: - Dropped the core.gitProxy change as per discussion. - Added a comment about the extra get_port. Note that after this series, parse_connect_url can be further refactored to avoid the kind of back-and-forth with host_end, get_host_and_port and get_port. Mike Hommey (9

[PATCH v7 1/9] connect: document why we sometimes call get_port after get_host_and_port

2016-05-21 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/connect.c b/connect.c index c53f3f1..caa2a3c 100644 --- a/connect.c +++ b/connect.c @@ -742,6 +742,12 @@ struct child_process *git_connect(int fd[2], const char

Re: [PATCH v6 2/9] connect: only match the host with core.gitProxy

2016-05-20 Thread Mike Hommey
On Fri, May 20, 2016 at 02:48:28PM -0700, Junio C Hamano wrote: > So, even if we agree that per-port behaviour is not something we > would use if we were building the system without any existing users > today, I do not think we want "git now fails with an error" at all. > It goes against the

Re: [PATCH v6 1/9] connect: call get_host_and_port() earlier

2016-05-20 Thread Mike Hommey
On Fri, May 20, 2016 at 03:20:23PM -0700, Junio C Hamano wrote: > Mike Hommey <m...@glandium.org> writes: > > >> Can never happen because? > >> > >> !*port means get_host_and_port() made the "port" pointer point at > >> a

Re: [PATCH v6 1/9] connect: call get_host_and_port() earlier

2016-05-20 Thread Mike Hommey
On Fri, May 20, 2016 at 01:58:26PM -0700, Junio C Hamano wrote: > Mike Hommey <m...@glandium.org> writes: > > > Currently, get_host_and_port() is called in git_connect() for the ssh > > protocol, and in git_tcp_connect_sock() for the git protocol. Instead > > of

Re: [PATCH] rev-parse: fix --git-common-dir when executed from subpath of main tree

2016-05-19 Thread Mike Hommey
On Sun, Apr 03, 2016 at 09:42:23PM -0400, Michael Rappazzo wrote: > Executing `git-rev-parse --git-common-dir` from the root of the main > worktree results in '.git', which is the relative path to the git dir. > When executed from a subpath of the main tree it returned somthing like: >

Re: [PATCH] rev-parse: fix --git-common-dir when executed from subpath of main tree

2016-05-19 Thread Mike Hommey
On Fri, Apr 08, 2016 at 08:35:51AM -0400, Mike Rappazzo wrote: > On Fri, Apr 8, 2016 at 7:47 AM, Duy Nguyen wrote: > > On Mon, Apr 4, 2016 at 8:42 AM, Michael Rappazzo wrote: > >> Executing `git-rev-parse --git-common-dir` from the root of the main > >>

[PATCH v6 4/9] connect: make parse_connect_url() return separated host and port

2016-05-16 Thread Mike Hommey
the "user@" part of the host, in order to pick the port properly. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 33 + t/t5500-fetch-pack.sh | 32 +--- 2 files changed, 42 insertions(+), 2

[PATCH v6 9/9] connect: move ssh command line preparation to a separate function

2016-05-16 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 108 +- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/connect.c b/connect.c index 7360d57..38cdffc 100644 --- a/connect.c +++ b/connect.c @@ -690,6 +

[PATCH v6 6/9] connect: make parse_connect_url() return the user part of the url as a separate value

2016-05-16 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/connect.c b/connect.c index 3a77b2f..2659b40 100644 --- a/connect.c +++ b/connect.c @@ -602,11 +602,13 @@ static char *get_por

[PATCH v6 2/9] connect: only match the host with core.gitProxy

2016-05-16 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 20 +--- t/t5532-fetch-proxy.sh | 8 +++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/connect.c b/connect.c index d3448c2..0f48cde 100644 --- a/connect.c +++ b/connect.c

[PATCH v6 3/9] connect: fill the host header in the git protocol with the host and port variables

2016-05-16 Thread Mike Hommey
. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 27 --- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/connect.c b/connect.c index 0f48cde..0676ee0 100644 --- a/connect.c +++ b/connect.c @@ -709,11 +709,24 @@ struct child_process *git_c

[PATCH v6 7/9] connect: change the --diag-url output to separate user and host

2016-05-16 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 6 ++ t/t5500-fetch-pack.sh | 14 -- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/connect.c b/connect.c index 2659b40..dcaf32f 100644 --- a/connect.c +++ b/connect.c @@ -720,10

[PATCH v6 1/9] connect: call get_host_and_port() earlier

2016-05-16 Thread Mike Hommey
however preserve hostandport, at least for now. Note that in git_tcp_connect_sock, the port was set to "" in a case that never can happen, so that code path was removed. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 47 +++

[PATCH v6 8/9] connect: actively reject git:// urls with a user part

2016-05-16 Thread Mike Hommey
Currently, urls of the for git://user@host don't work because user@host is not resolving at the DNS level, but we shouldn't be relying on it being an invalid host name, and actively reject it for containing a username in the first place. Signed-off-by: Mike Hommey <m...@glandium.

[PATCH v6 0/9] connect: various cleanups

2016-05-16 Thread Mike Hommey
The main difference here is patch 2/9 now throwing an error in user's face when they have a core.gitProxy configuration with a port number. There might be some bikeshedding to do on the content of the error message. Mike Hommey (9): connect: call get_host_and_port() earlier connect: only

[PATCH v6 5/9] connect: group CONNECT_DIAG_URL handling code

2016-05-16 Thread Mike Hommey
Previous changes made both branches handling CONNECT_DIAG_URL identical. We can now remove one of those branches and have CONNECT_DIAG_URL be handled in one place. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 16 +--- 1 file changed, 1 insertion(+), 15 del

Re: [PATCH v5 4/9] connect: make parse_connect_url() return separated host and port

2016-05-16 Thread Mike Hommey
On Mon, May 16, 2016 at 03:39:08PM -0700, Junio C Hamano wrote: > Mike Hommey <m...@glandium.org> writes: > > > + get_host_and_port(, ); > > + > > + if (*host && !port) { > > + /* The host might contain a user:password string, ignore it &g

[PATCH v5 1/9] connect: call get_host_and_port() earlier

2016-05-15 Thread Mike Hommey
however preserve hostandport, at least for now. Note that in git_tcp_connect_sock, the port was set to "" in a case that never can happen, so that code path was removed. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 47 +++

[PATCH v5 8/9] connect: actively reject git:// urls with a user part

2016-05-15 Thread Mike Hommey
Currently, urls of the for git://user@host don't work because user@host is not resolving at the DNS level, but we shouldn't be relying on it being an invalid host name, and actively reject it for containing a username in the first place. Signed-off-by: Mike Hommey <m...@glandium.

[PATCH v5 0/9] connect: various cleanups

2016-05-15 Thread Mike Hommey
I removed the two controvertial patches, and applied the various suggestions from the last cycle. Mike Hommey (9): connect: call get_host_and_port() earlier connect: only match the host with core.gitProxy connect: fill the host header in the git protocol with the host and port variables

[PATCH v5 3/9] connect: fill the host header in the git protocol with the host and port variables

2016-05-15 Thread Mike Hommey
. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 27 --- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/connect.c b/connect.c index 2a08318..ed1a00d 100644 --- a/connect.c +++ b/connect.c @@ -695,11 +695,24 @@ struct child_process *git_c

[PATCH v5 6/9] connect: make parse_connect_url() return the user part of the url as a separate value

2016-05-15 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/connect.c b/connect.c index 8813f90..c40ff35 100644 --- a/connect.c +++ b/connect.c @@ -588,11 +588,13 @@ static char *get_por

[PATCH v5 5/9] connect: group CONNECT_DIAG_URL handling code

2016-05-15 Thread Mike Hommey
Previous changes made both branches handling CONNECT_DIAG_URL identical. We can now remove one of those branches and have CONNECT_DIAG_URL be handled in one place. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 16 +--- 1 file changed, 1 insertion(+), 15 del

[PATCH v5 9/9] connect: move ssh command line preparation to a separate function

2016-05-15 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 108 +- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/connect.c b/connect.c index fdd40b0..ae9ef7b 100644 --- a/connect.c +++ b/connect.c @@ -673,6 +

[PATCH v5 2/9] connect: only match the host with core.gitProxy

2016-05-15 Thread Mike Hommey
This per-port behavior seems like an oversight rather than a deliberate choice, so, make git://kernel.org:port/path call the gitProxy script in the case described above. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH v5 7/9] connect: change the --diag-url output to separate user and host

2016-05-15 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 6 ++ t/t5500-fetch-pack.sh | 14 -- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/connect.c b/connect.c index c40ff35..df15ff3 100644 --- a/connect.c +++ b/connect.c @@ -703,10

Re: [PATCH v4 01/11] add fetch-pack --diag-url tests for some corner cases

2016-05-05 Thread Mike Hommey
On Wed, May 04, 2016 at 07:48:30AM +0900, Mike Hommey wrote: > On Tue, May 03, 2016 at 09:07:41AM -0700, Junio C Hamano wrote: > > Mike Hommey <m...@glandium.org> writes: > > > > > t5603-clone-dirname uses url patterns that are not tested with > > > fetch-

Re: [PATCH v4 09/11] connect: use "-l user" instead of "user@" on ssh command line

2016-05-03 Thread Mike Hommey
On Tue, May 03, 2016 at 01:33:24PM -0400, Eric Sunshine wrote: > On Tue, May 3, 2016 at 4:50 AM, Mike Hommey <m...@glandium.org> wrote: > > While it is not strictly necessary, it makes the connect code simpler > > when there is user. > > > > Signed-off-b

Re: [PATCH v4 08/11] connect: change the --diag-url output to separate user and host

2016-05-03 Thread Mike Hommey
On Tue, May 03, 2016 at 01:23:37PM -0400, Eric Sunshine wrote: > On Tue, May 3, 2016 at 12:20 PM, Torsten Bögershausen <tbo...@web.de> wrote: > > On 2016-05-03 10.50, Mike Hommey wrote: > >> - git fetch-pack --diag-url "$1" | grep -v host= | grep -v port= &g

Re: [PATCH v4 01/11] add fetch-pack --diag-url tests for some corner cases

2016-05-03 Thread Mike Hommey
On Tue, May 03, 2016 at 09:07:41AM -0700, Junio C Hamano wrote: > Mike Hommey <m...@glandium.org> writes: > > > t5603-clone-dirname uses url patterns that are not tested with > > fetch-pack --diag-url, and it would be useful if they were. > > > > Interestingly,

[PATCH v4.1 11/11] connect: move ssh command line preparation to a separate function

2016-05-03 Thread Mike Hommey
--- connect.c | 109 ++ 1 file changed, 59 insertions(+), 50 deletions(-) Err, I had forgotten to commit --amend to add a missing argument. diff --git a/connect.c b/connect.c index 215d6d9..5f86983 100644 --- a/connect.c +++

[PATCH v4 01/11] add fetch-pack --diag-url tests for some corner cases

2016-05-03 Thread Mike Hommey
by git, the values used could be valid user names (user names can actually contain colons and at signs), and are still worth testing the url parser for. Signed-off-by: Mike Hommey <m...@glandium.org> --- t/t5500-fetch-pack.sh | 38 ++ 1 file changed, 34 inse

[PATCH v4 08/11] connect: change the --diag-url output to separate user and host

2016-05-03 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 6 ++ t/t5500-fetch-pack.sh | 14 -- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/connect.c b/connect.c index e95e385..2c5b722 100644 --- a/connect.c +++ b/connect.c @@ -703,10

[PATCH v4 07/11] connect: make parse_connect_url() return the user part of the url as a separate value

2016-05-03 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 37 + 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/connect.c b/connect.c index 8813f90..e95e385 100644 --- a/connect.c +++ b/connect.c @@ -588,11 +588,13 @@ static char *ge

[PATCH v4 04/11] connect: fill the host header in the git protocol with the host and port variables

2016-05-03 Thread Mike Hommey
. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 27 --- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/connect.c b/connect.c index 2a08318..ed1a00d 100644 --- a/connect.c +++ b/connect.c @@ -695,11 +695,24 @@ struct child_process *git_c

[PATCH v4 10/11] connect: actively reject git:// urls with a user part

2016-05-03 Thread Mike Hommey
Currently, urls of the for git://user@host don't work because user@host is not resolving at the DNS level, but we shouldn't be relying on it being an invalid host name, and actively reject it for containing a username in the first place. Signed-off-by: Mike Hommey <m...@glandium.

[PATCH v4 00/11] connect: various cleanups

2016-05-03 Thread Mike Hommey
I went even further this time around. I'm not totally satistifed with the resulting parse_connect_url function, but at least it feels to me this series puts us in a better place to actually improve it further. Mike Hommey (11): add fetch-pack --diag-url tests for some corner cases connect

[PATCH v4 02/11] connect: call get_host_and_port() earlier

2016-05-03 Thread Mike Hommey
however preserve hostandport, at least for now. Note that in git_tcp_connect_sock, the port was set to "" in a case that never can happen, so that code path was removed. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 47 +++

[PATCH v4 09/11] connect: use "-l user" instead of "user@" on ssh command line

2016-05-03 Thread Mike Hommey
While it is not strictly necessary, it makes the connect code simpler when there is user. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c| 12 t/t5601-clone.sh | 52 2 files changed, 48 insertions(

[PATCH v4 06/11] connect: group CONNECT_DIAG_URL handling code

2016-05-03 Thread Mike Hommey
Previous changes made both branches handling CONNECT_DIAG_URL identical. We can now remove one of those branches and have CONNECT_DIAG_URL be handled in one place. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 16 +--- 1 file changed, 1 insertion(+), 15 del

[PATCH v4 11/11] connect: move ssh command line preparation to a separate function

2016-05-03 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 109 ++ 1 file changed, 59 insertions(+), 50 deletions(-) diff --git a/connect.c b/connect.c index 215d6d9..37b3140 100644 --- a/connect.c +++ b/connect.c @@ -673,6 +

[PATCH v4 05/11] connect: make parse_connect_url() return separated host and port

2016-05-03 Thread Mike Hommey
the "user@" part of the host, in order to pick the port properly. This also fixes the tests added 4 commits ago. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 30 ++ t/t5500-fetch-pack.sh | 38 +

[PATCH v4 03/11] connect: only match the host with core.gitProxy

2016-05-03 Thread Mike Hommey
This per-port behavior seems like an oversight rather than a deliberate choice, so, make git://kernel.org:port/path call the gitProxy script in the case described above. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

Re: [PATCH 1/6] connect: remove get_port()

2016-05-02 Thread Mike Hommey
On Tue, May 03, 2016 at 01:03:38AM -0400, Jeff King wrote: > On Sun, May 01, 2016 at 12:10:09PM +0200, Torsten Bögershausen wrote: > > > On 2016-05-01 08.02, Mike Hommey wrote: > > > get_port() is only used as a fallback when get_host_and_port() does not > > > retu

Re: [PATCH 2/6] connect: uniformize and group CONNECT_DIAG_URL handling code

2016-05-02 Thread Mike Hommey
On Mon, May 02, 2016 at 01:29:15PM +0200, Torsten Bögershausen wrote: > On 05/02/2016 10:31 AM, Mike Hommey wrote: > > On Mon, May 02, 2016 at 06:56:54AM +0200, Torsten Bögershausen wrote: > > > On 05/01/2016 08:02 AM, Mike Hommey wrote: > > > > +

Re: [PATCH 2/6] connect: uniformize and group CONNECT_DIAG_URL handling code

2016-05-02 Thread Mike Hommey
On Mon, May 02, 2016 at 06:56:54AM +0200, Torsten Bögershausen wrote: > On 05/01/2016 08:02 AM, Mike Hommey wrote: > > + if (flags & CONNECT_DIAG_URL) { > > printf("Diag: url=%s\n", url ? url : "NULL"); > > pri

Re: [PATCH 2/6] connect: uniformize and group CONNECT_DIAG_URL handling code

2016-05-01 Thread Mike Hommey
On Sun, May 01, 2016 at 03:37:24PM +0200, Torsten Bögershausen wrote: > I skipped the dates and names (I was responsible for one regression) > I hope this gives a half-correct overview, > why I am reluctant to change any code in connect.c > unless there is a fix for a real world problem. I don't

Re: [PATCH 1/6] connect: remove get_port()

2016-05-01 Thread Mike Hommey
On Sun, May 01, 2016 at 12:10:09PM +0200, Torsten Bögershausen wrote: > On 2016-05-01 08.02, Mike Hommey wrote: > > get_port() is only used as a fallback when get_host_and_port() does not > > return a port. But get_port() does the same search as > > get_host_and_port(), exc

[PATCH 2/6] connect: uniformize and group CONNECT_DIAG_URL handling code

2016-05-01 Thread Mike Hommey
() is used further down the line. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 28 +--- t/t5500-fetch-pack.sh | 25 +++-- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/connect.c b/connect.c index 45308ef..9

[PATCH 4/6] connect: pass separate host and port to git_tcp_connect and git_proxy_connect

2016-05-01 Thread Mike Hommey
, the port was set to "" in a case that never can happen, so that code path was removed. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 31 ++- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/connect.c b/connect.c index 1c8ed6b

[PATCH 5/6] connect: don't xstrdup target_host

2016-05-01 Thread Mike Hommey
Now that hostandport is left unmodified in git_connect (we don't pass it to get_host_and_port() anymore), we can avoid xstrdup'ing it. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/connect.c b/connect.c

[PATCH v3 0/6] connect: various cleanups

2016-05-01 Thread Mike Hommey
er in which the changes have been done in this new series is debatable, but I thought the split in smaller parts made things easier to review, even if they could have been done in different orders. I'm leaving the optional follows-up for now. I'll work around the functions being static somehow on my

[PATCH 1/6] connect: remove get_port()

2016-05-01 Thread Mike Hommey
get_host_and_port(), works on a modified host string that has square brackes removed if there were any. I cannot think of any legal host:port string that would not have a port returned by get_host_and_port() *and* have one returned by get_port(). So just remove get_port(). Signed-off-by: Mike Hommey &l

[PATCH 3/6] connect: only match the host with core.gitProxy

2016-05-01 Thread Mike Hommey
This per-port behavior seems like an oversight rather than a deliberate choice, so, make git://kernel.org:port/path call the gitProxy script in the case described above. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH 6/6] connect: move ssh command line preparation to a separate function

2016-05-01 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 101 ++ 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/connect.c b/connect.c index e2b976e..db78eb2 100644 --- a/connect.c +++ b/connect.c @@ -639,6 +

[RFC PATCH 1/3] connect: make parse_connect_url public

2016-04-28 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 11 ++- connect.h | 9 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/connect.c b/connect.c index c53f3f1..29569b3 100644 --- a/connect.c +++ b/connect.c @@ -231,13 +231,6 @@ int server_su

[RFC PATCH 2/3] connect: group CONNECT_DIAG_URL handling code

2016-04-28 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 27 --- 1 file changed, 12 insertions(+), 15 deletions(-) Note this makes http://marc.info/?l=git=146183714532394 irrelevant. diff --git a/connect.c b/connect.c index 29569b3..ce216cb 100644 --- a/con

[RFC PATCH 3/3] connect: move ssh command line preparation to a separate (public) function

2016-04-28 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 108 +- connect.h | 2 ++ 2 files changed, 60 insertions(+), 50 deletions(-) diff --git a/connect.c b/connect.c index ce216cb..c71563f 100644 --- a/connect.c

Re: [RFC PATCH 0/4] git_connect: add some flexibility

2016-04-28 Thread Mike Hommey
On Thu, Apr 28, 2016 at 10:41:12AM -0700, Junio C Hamano wrote: > Mike Hommey <m...@glandium.org> writes: > > > As you may be aware, I'm working on a git remote helper to access > > mercurial repositories (https://github.com/glandium/git-cinnabar/). > > > > At

[PATCH 1/4] git_connect: extend to take a pseudo format string for the program to run

2016-04-28 Thread Mike Hommey
. With this change, when the program/command passed to git_connect() contains a "%s", that "%s" is replaced with the path from the url, allowing the path to be at a different position than last on the executed command line. Signed-off-by: Mike Hommey <m...@glandium.o

[PATCH 4/4] git_connect: add a flag to consider the path part of ssh urls relative

2016-04-28 Thread Mike Hommey
In Mercurial ssh urls, the path part of the url is relative to the home directory of the account being logged to instead of being absolute. Add a flag allowing git_connect() to handle this kind of usecase. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 10 +++--- con

[RFC PATCH 0/4] git_connect: add some flexibility

2016-04-28 Thread Mike Hommey
could be done in sq_quote_buf instead, arguably. I'm certainly open to any better ideas as long as they can make it to mainline :). Mike Hommey (4): git_connect: extend to take a pseudo format string for the program to run git_connect: avoid quoting the path on the command line when it's n

[PATCH 3/4] git_connect: allow a file descriptor to be allocated for stderr

2016-04-28 Thread Mike Hommey
It can be useful to the caller of git_connect() to get access to stderr, so add a flag that makes start_command allocate a file descriptor for it. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 2 ++ connect.h | 1 + 2 files changed, 3 insertions(+) diff --git a/conne

[PATCH 2/4] git_connect: avoid quoting the path on the command line when it's not necessary

2016-04-28 Thread Mike Hommey
o the list. Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/connect.c b/connect.c index 96c8c1d..919bf9e 100644 --- a/connect.c +++ b/connect.c @@ -668,6 +668,17 @@ static void prepare_connect_command(struct strbuf *

[PATCH] Fix memory leak in git_connect with CONNECT_DIAG_URL

2016-04-28 Thread Mike Hommey
Signed-off-by: Mike Hommey <m...@glandium.org> --- connect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/connect.c b/connect.c index c53f3f1..dccf673 100644 --- a/connect.c +++ b/connect.c @@ -755,6 +755,7 @@ struct child_process *git_connect(int fd[2], const char

Announcing git-cinnabar 0.3.2

2016-04-27 Thread Mike Hommey
Git-cinnabar is a git remote helper to interact with mercurial repositories. It allows to clone, pull and push from/to mercurial remote repositories, using git. Code on https://github.com/glandium/git-cinnabar [ Previous announcements: http://marc.info/?l=git=145294370431454

Re: fast-import's gfi_unpack_entry causes too many munmap/mmap cycles

2016-04-16 Thread Mike Hommey
On Sun, Apr 17, 2016 at 09:54:43AM +0900, Mike Hommey wrote: > On Sat, Apr 16, 2016 at 08:04:03PM +0900, Mike Hommey wrote: > > So I think I got myself a workaround... > > > > > A --- B > > > \ > > > \-- C > > > > > > I have: >

Re: fast-import's gfi_unpack_entry causes too many munmap/mmap cycles

2016-04-16 Thread Mike Hommey
On Sat, Apr 16, 2016 at 08:04:03PM +0900, Mike Hommey wrote: > So I think I got myself a workaround... > > > A --- B > > \ > > \-- C > > > > I have: > > - diff between null-tree and A > > - diff between A and B > > - diff between B and

Re: fast-import's gfi_unpack_entry causes too many munmap/mmap cycles

2016-04-16 Thread Mike Hommey
On Sat, Apr 16, 2016 at 06:18:39PM +0900, Mike Hommey wrote: > And even if I am okay with that overhead, I still hit the problem again > when using that tree later with `M 04 $sha1 ` in the next commit, > because that does a load_tree() for the tree sha1, after a commit having &

Re: fast-import's gfi_unpack_entry causes too many munmap/mmap cycles

2016-04-16 Thread Mike Hommey
On Sat, Apr 16, 2016 at 06:18:39PM +0900, Mike Hommey wrote: > Now, while each individual case could be improved to avoid > gfi_unpack_entry, it seems to me it would be better to make > gfi_unpack_entry better somehow. Come to think of it, there are cases that might still be worth fix

fast-import's gfi_unpack_entry causes too many munmap/mmap cycles

2016-04-16 Thread Mike Hommey
Hi, I think I've mentioned this issue in the past, and fixed one case of munmap/mmap cycle in fast-import. I've found more cases where this can happen, and while on Linux, it's not a problem, on OSX, it leads to catastrophic performance, when the import is massive. One part of the problem is

Re: Ambiguous sha-1 during a rebase

2016-04-14 Thread Mike Hommey
On Thu, Apr 14, 2016 at 11:09:06AM +0200, Matthieu Moy wrote: > I suspect you did: > > $ git rebase -i > # editor pops up > # switch to another terminal and fetch from elsewhere > # close editor That's possible, but I don't remember with certainty. At least it's plausible. > Then only, git

Re: Ambiguous sha-1 during a rebase

2016-04-13 Thread Mike Hommey
On Wed, Apr 13, 2016 at 03:42:44PM -0700, Junio C Hamano wrote: > Mike Hommey <m...@glandium.org> writes: > > > Should git-rebase use full sha-1s under the hood to avoid these type of > > races? > > It already should be doing so since Aug 2013, IIRC. I'm usin

Ambiguous sha-1 during a rebase

2016-04-13 Thread Mike Hommey
Hi, Something interesting happened to me. I was in the middle of an interactive rebase, and after a --continue, I got: error: short SHA1 e34ff55 is ambiguous. fatal: Needed a single revision Invalid commit name: e34ff55 One thing that happened, is that, while running that interactive rebase, I

Re: [PATCH][Outreachy] branch: allow - as abbreviation of '@{-1}'

2016-03-19 Thread Mike Hommey
On Fri, Mar 18, 2016 at 09:10:37AM -0700, Junio C Hamano wrote: > * We forbid declaration-after-statement in our codebase. By the way, why not enforce it with -Werror=declaration-after-statement? If people patching git get an error when they do it, they won't submit a patch with it, and you

`git rev-parse --git-common-dir` doesn't work in a subdirectory of the main work tree

2016-02-11 Thread Mike Hommey
Hi, In a worktree, git rev-parse --git-common-dir returns the non worktree-specific git directory. e.g. .git instead of .git/worktrees/name. The problem is that while it returns the right thing from a subdirectory of a worktree, it doesn't from a subdirectory of the "main" work tree. In the

Re: Bug: Branch Deletion Doesn't Clean Up

2016-02-04 Thread Mike Hommey
On Thu, Feb 04, 2016 at 02:55:00AM -0500, Jeff King wrote: > [resend; sorry, I forgot to cc Michael on the first one] > > On Thu, Jan 07, 2016 at 02:24:41PM -0500, Karl Moskowski wrote: > > > The problem is, deleting a branch whose name contains slashes doesn’t > > delete the directories in

Re: Bug: Branch Deletion Doesn't Clean Up

2016-02-04 Thread Mike Hommey
On Thu, Feb 04, 2016 at 03:17:59AM -0500, Jeff King wrote: > On Thu, Feb 04, 2016 at 05:12:20PM +0900, Mike Hommey wrote: > > > > > It seems like git branch -d ascend the hierarchy (up to > > > > .git/refs/heads/), deleting any empty directories. > > > &

parse_object does check_sha1_signature but not parse_object_buffer?

2016-02-01 Thread Mike Hommey
Hi, You might or might not be aware of this thread: https://groups.google.com/forum/#!topic/binary-transparency/f-BI4o8HZW0 Anyways, this got me to take a look around, and I noticed that parse_object does SHA-1 validation through check_sha1_signature. What surprised me is that

Re: parse_object does check_sha1_signature but not parse_object_buffer?

2016-02-01 Thread Mike Hommey
On Tue, Feb 02, 2016 at 10:57:01AM +0900, Mike Hommey wrote: > Hi, > > You might or might not be aware of this thread: > https://groups.google.com/forum/#!topic/binary-transparency/f-BI4o8HZW0 > > Anyways, this got me to take a look around, and I noticed that > parse_object

Re: parse_object does check_sha1_signature but not parse_object_buffer?

2016-02-01 Thread Mike Hommey
On Mon, Feb 01, 2016 at 07:10:04PM -0800, Junio C Hamano wrote: > Mike Hommey <m...@glandium.org> writes: > > > Shouldn't parse_object_buffer also do check_sha1_signature? > > In general, it shouldn't; its callers are supposed to do it as > additional check when/if ne

Re: Is there interest in a n-sect tool?

2016-01-20 Thread Mike Hommey
On Wed, Jan 20, 2016 at 02:05:22PM -0800, Junio C Hamano wrote: > Mike Hommey <m...@glandium.org> writes: > > > On Mon, Jan 18, 2016 at 07:54:21PM -0800, Junio C Hamano wrote: > > > >> Hmm, sorry. For the two-trait example I gave (that can be extended > &

Re: RefTree: Alternate ref backend

2015-12-17 Thread Mike Hommey
On Thu, Dec 17, 2015 at 02:28:01PM -0800, Shawn Pearce wrote: > On Thu, Dec 17, 2015 at 2:10 PM, Jeff King wrote: > > On Thu, Dec 17, 2015 at 01:02:50PM -0800, Shawn Pearce wrote: > > > >> I started playing around with the idea of storing references directly > >> in Git. Exploiting

Re: Feature request: commit count in git-describe should use a different method

2015-11-03 Thread Mike Hommey
On Wed, Nov 04, 2015 at 12:11:27PM +0700, Robin Munn wrote: > Several people (including me) seem to expect git-describe's commit > count to be calculated differently than how it's actually calculated. > For example, see the following three Stack Overflow questions: > >

[PATCH v6] notes: allow treeish expressions as notes ref

2015-10-07 Thread Mike Hommey
, or will be updated. With this change, operations that use notes read-only can be fed any notes-shaped tree-ish can be used, e.g. git log --notes=notes@{1}. Signed-off-by: Mike Hommey <m...@glandium.org> --- I'm really not satisfied with the documentation change, but I don't have a better id

Re: [PATCH] notes: Allow treeish expressions as notes ref

2015-10-07 Thread Mike Hommey
stinction: $ ./git-log --notes=fdsfgsfdg HEAD^! --pretty=short warning: notes ref refs/notes/fdsfgsfdg is invalid commit e5b68b2e879608d881c2e3600ce84962fcdefc88 Author: Mike Hommey <m...@glandium.org> notes: allow treeish expressions as notes ref $ ./git-log --notes=foo HEAD

Re: [PATCH 0/2] notes: allow read only notes actions on refs outside of refs/notes

2015-09-16 Thread Mike Hommey
On Wed, Sep 16, 2015 at 03:06:32PM -0700, Jacob Keller wrote: > This topic depends on mh/notes-allow-reading-treeish and actually > expands what this topic allowed before. Previously, treeishes such as > notes@{1} were made allowable, but the ref still had to be found under > refs/notes. I

Re: fetching from an hg remote fails with bare git repositories

2015-08-04 Thread Mike Hommey
On Tue, Aug 04, 2015 at 05:27:13PM -0400, Taylor Braun-Jones wrote: On Tue, Aug 4, 2015 at 2:56 PM, Stefan Beller sbel...@google.com wrote: On Tue, Aug 4, 2015 at 10:45 AM, Taylor Braun-Jones tay...@braun-jones.org wrote: Fetching from an hg remote fails with bare git repositories. Non-bare

<    1   2   3   4   >