From: Mike Hommey <mh@glandium.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, tboegi@web.de
Subject: Re: [PATCH v5 4/9] connect: make parse_connect_url() return separated host and port
Date: Tue, 17 May 2016 07:53:41 +0900 [thread overview]
Message-ID: <20160516225341.GA19595@glandium.org> (raw)
In-Reply-To: <xmqqr3d1zkz7.fsf@gitster.mtv.corp.google.com>
On Mon, May 16, 2016 at 03:39:08PM -0700, Junio C Hamano wrote:
> Mike Hommey <mh@glandium.org> writes:
>
> > + get_host_and_port(&host, &port);
> > +
> > + if (*host && !port) {
> > + /* The host might contain a user:password string, ignore it
> > + * when searching for the port again */
> > + char *end_user = strrchr(host, '@');
> > + port = get_port(end_user ? end_user : host);
>
> Scanning from the right because host part would never have '@', but
> there could be an invalid URL with an unquoted '@' in userinfo part?
> Then this makes sense.
Indeed, I forgot to update the comment after the discussion on this
list.
> > diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
> > index 91a69fc..9acba2b 100755
> > --- a/t/t5500-fetch-pack.sh
> > +++ b/t/t5500-fetch-pack.sh
> > @@ -553,7 +553,7 @@ check_prot_path () {
> > Diag: protocol=$2
> > Diag: path=$3
> > EOF
> > - git fetch-pack --diag-url "$1" | grep -v hostandport= >actual &&
> > + git fetch-pack --diag-url "$1" | grep -v host= | grep -v port= >actual &&
>
> A single process:
>
> ... | grep -v -e '^host=' -e '^port='
heh, I'm actually replacing it with a single egrep in a subsequent
patch, following feedback from previous round, but missed that there was
this intermediate step with multiple greps still. Do you want an update
anyways, or does only the final result really matter? I guess I can
update it in any case, since I'll have to update the patch for the
comment above anyways.
Mike
next prev parent reply other threads:[~2016-05-16 22:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-16 0:07 [PATCH v5 0/9] connect: various cleanups Mike Hommey
2016-05-16 0:07 ` [PATCH v5 1/9] connect: call get_host_and_port() earlier Mike Hommey
2016-05-16 0:07 ` [PATCH v5 2/9] connect: only match the host with core.gitProxy Mike Hommey
2016-05-16 22:30 ` Junio C Hamano
2016-05-16 22:36 ` Mike Hommey
2016-05-16 22:54 ` Junio C Hamano
2016-05-16 0:07 ` [PATCH v5 3/9] connect: fill the host header in the git protocol with the host and port variables Mike Hommey
2016-05-16 0:07 ` [PATCH v5 4/9] connect: make parse_connect_url() return separated host and port Mike Hommey
2016-05-16 22:39 ` Junio C Hamano
2016-05-16 22:53 ` Mike Hommey [this message]
2016-05-16 0:07 ` [PATCH v5 5/9] connect: group CONNECT_DIAG_URL handling code Mike Hommey
2016-05-16 0:07 ` [PATCH v5 6/9] connect: make parse_connect_url() return the user part of the url as a separate value Mike Hommey
2016-05-16 0:07 ` [PATCH v5 7/9] connect: change the --diag-url output to separate user and host Mike Hommey
2016-05-16 0:07 ` [PATCH v5 8/9] connect: actively reject git:// urls with a user part Mike Hommey
2016-05-16 22:41 ` Junio C Hamano
2016-05-16 0:07 ` [PATCH v5 9/9] connect: move ssh command line preparation to a separate function Mike Hommey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160516225341.GA19595@glandium.org \
--to=mh@glandium.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=tboegi@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).