From: Junio C Hamano <gitster@pobox.com>
To: "Kyle J. McKay" <mackyle@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH ALTERNATIVE v6.v3 4/6] config: parse http.<url>.<variable> using urlmatch
Date: Mon, 05 Aug 2013 15:56:36 -0700 [thread overview]
Message-ID: <7vsiyniw63.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <5acf57129e37a87611ed03648f7b368@f74d39fa044aa309eaea14b9f57fe79> (Kyle J. McKay's message of "Mon, 5 Aug 2013 13:20:36 -0700")
"Kyle J. McKay" <mackyle@gmail.com> writes:
> Use the urlmatch_config_entry() to wrap the underlying
> http_options() two-level variable parser in order to set
> http.<variable> to the value with the most specific URL in the
> configuration.
>
> Signed-off-by: Jeff King <peff@peff.net>
> Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
Oops, what did we sign-off?
> This version of 4/6 moves the tests to t0110 since urlmatch is now global.
> The config tests are removed since part 6/6 already has those and they no
> longer belong with the urlmatch normalization tests.
>
> The Makefile rule has been removed since it's no longer needed to build
> correctly as the test program no longer includes http.c.
>
> Other than those changes (and a minor rename to reflect the new location),
> this patch is identical to the previous v6.v2 4/6.
Ahh, figures. Thanks.
Peff, any comments?
> diff --git a/t/t0110-urlmatch-normalization.sh b/t/t0110-urlmatch-normalization.sh
> new file mode 100755
> index 00000000..8d6096d4
> --- /dev/null
> +++ b/t/t0110-urlmatch-normalization.sh
> @@ -0,0 +1,177 @@
> +#!/bin/sh
> +
> +test_description='urlmatch URL normalization'
> +. ./test-lib.sh
> +
> +# The base name of the test url files
> +tu="$TEST_DIRECTORY/t0110/url"
> +
> +# Note that only file: URLs should be allowed without a host
It is somewhat unfortunate that the form most commonly used for
pushing is not supported at all, i.e.
host:path
Current configuration set may not have anything interesting to
affect the git-over-ssh push codepath, so in practice it may not
matter, though.
> +test_expect_success 'url authority' '
"authority" refers to the host part? (not a complaint, but is a
question)
> +test_expect_success 'url port checks' '
> + test-urlmatch-normalization "xyz://q@some.host:" &&
This is presumably replaced by a default port for xyz:// scheme,
whatever the default port is, in other words, it is as if no colon
is given at the end?
> + test-urlmatch-normalization "xyz://q@some.host:456/" &&
> + ! test-urlmatch-normalization "xyz://q@some.host:0" &&
> + ! test-urlmatch-normalization "xyz://q@some.host:0000000" &&
Port #0 is disallowed?
> + test-urlmatch-normalization "xyz://q@some.host:0000001?" &&
Is it the same as specifying "xyz://q@some.host:1?" and does it
match "xyz://q@some.host:1"?
> + test-urlmatch-normalization "xyz://q@some.host:065535#" &&
Ditto, for 65535 and without #-fragment at the end?
> +test_expect_success 'url port normalization' '
> + test "$(test-urlmatch-normalization -p "http://x:800")" = "http://x:800/" &&
> + test "$(test-urlmatch-normalization -p "http://x:0800")" = "http://x:800/" &&
> + test "$(test-urlmatch-normalization -p "http://x:00000800")" = "http://x:800/" &&
> + test "$(test-urlmatch-normalization -p "http://x:065535")" = "http://x:65535/" &&
> + test "$(test-urlmatch-normalization -p "http://x:1")" = "http://x:1/" &&
> + test "$(test-urlmatch-normalization -p "http://x:80")" = "http://x/" &&
> + test "$(test-urlmatch-normalization -p "http://x:080")" = "http://x/" &&
> + test "$(test-urlmatch-normalization -p "http://x:000000080")" = "http://x/" &&
> + test "$(test-urlmatch-normalization -p "https://x:443")" = "https://x/" &&
> + test "$(test-urlmatch-normalization -p "https://x:0443")" = "https://x/" &&
> + test "$(test-urlmatch-normalization -p "https://x:000000443")" = "https://x/"
> +'
OK, these answer most of the previous questions.
> +# http://@foo specifies an empty user name but does not specify a password
> +# http://foo specifies neither a user name nor a password
> +# So they should not be equivalent
> +test_expect_success 'url equivalents' '
> + test-urlmatch-normalization "httP://x" "Http://X/" &&
> + test-urlmatch-normalization "Http://%4d%65:%4d^%70@The.Host" "hTTP://Me:%4D^p@the.HOST:80/" &&
> + ! test-urlmatch-normalization "https://@x.y/^" "httpS://x.y:443/^" &&
The comment is about this test, which seems to make sense. What is
"^"? Just a random valid character that can appear in the path?
(not a complaint, but is a question).
next prev parent reply other threads:[~2013-08-05 22:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 19:26 [PATCH v6 0/6] http.<url>.<key> and friends Junio C Hamano
2013-07-31 19:26 ` [PATCH v6 1/6] http.c: fix parsing of http.sslCertPasswordProtected variable Junio C Hamano
2013-07-31 19:26 ` [PATCH v6 2/6] config: add helper to normalize and match URLs Junio C Hamano
2013-07-31 20:50 ` Kyle J. McKay
2013-07-31 19:26 ` [PATCH v6 3/6] config: add generic callback wrapper to parse section.<url>.key Junio C Hamano
2013-07-31 19:26 ` [PATCH v6 4/6] config: parse http.<url>.<variable> using urlmatch Junio C Hamano
2013-07-31 20:51 ` Kyle J. McKay
2013-07-31 20:51 ` [PATCH ALTERNATIVE v6 0/2] http.<url>.<key> and friends Kyle J. McKay
2013-07-31 20:52 ` [PATCH ALTERNATIVE v6 2/4] config: add helper to normalize and match URLs Kyle J. McKay
2013-07-31 20:52 ` [PATCH ALTERNATIVE v6 4/4] config: parse http.<url>.<variable> using urlmatch Kyle J. McKay
2013-07-31 22:01 ` [PATCH ALTERNATIVE v6 0/2] http.<url>.<key> and friends Junio C Hamano
2013-07-31 22:41 ` [PATCH ALTERNATIVE v6.v2 4/6] config: parse http.<url>.<variable> using urlmatch Kyle J. McKay
2013-07-31 19:26 ` [PATCH v6 5/6] builtin/config: refactor collect_config() Junio C Hamano
2013-07-31 19:26 ` [PATCH v6 6/6] config: "git config --get-urlmatch" parses section.<url>.key Junio C Hamano
2013-07-31 22:45 ` Jeff King
2013-07-31 23:03 ` Kyle J. McKay
2013-07-31 23:44 ` Jeff King
2013-08-01 17:25 ` Junio C Hamano
2013-08-01 17:30 ` Jeff King
2013-08-05 20:20 ` [PATCH ALTERNATIVE v6.v3 4/6] config: parse http.<url>.<variable> using urlmatch Kyle J. McKay
2013-08-05 22:56 ` Junio C Hamano [this message]
2013-08-05 23:57 ` Kyle J. McKay
2013-07-31 23:47 ` [PATCH v6 6/6] config: "git config --get-urlmatch" parses section.<url>.key Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vsiyniw63.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mackyle@gmail.com \
--cc=peff@peff.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).