git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, psteinhardt@elego.de
Subject: Re: What's cooking in git.git (Jan 2017, #06; Tue, 31)
Date: Wed, 1 Feb 2017 12:08:51 +0100	[thread overview]
Message-ID: <20170201110851.GA475@pks-pc> (raw)
In-Reply-To: <xmqqpoj2q25n.fsf@gitster.mtv.corp.google.com>

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

On Tue, Jan 31, 2017 at 02:45:40PM -0800, Junio C Hamano wrote:
> * ps/urlmatch-wildcard (2017-01-31) 5 commits
>  . urlmatch: allow globbing for the URL host part
>  . urlmatch: include host in urlmatch ranking
>  . urlmatch: split host and port fields in `struct url_info`
>  . urlmatch: enable normalization of URLs with globs
>  . mailmap: add Patrick Steinhardt's work address
> 
>  The <url> part in "http.<url>.<variable>" configuration variable
>  can now be spelled with '*' that serves as wildcard.
>  E.g. "http.https://*.example.com.proxy" can be used to specify the
>  proxy used for https://a.example.com, https://b.example.com, etc.,
>  i.e. any host in the example.com domain.
> 
>  With the update it still seems to fail the same t5551#31
>  cf. <cover.1485853153.git.ps@pks.im>

Yeah, you're right. Sorry about this one.

I finally fixed the problem to get t5551 working again, see the
attached patch below. The problem was that I did not honor the
case where multiple configuration entries exist with the same
key. In some cases, this has to lead to the value being
accumulated multiple times, as for example with http.extraheaders
used in t5551. So the fixup below fixes this.

I just tried to write additional tests to exercise this in our
config-tests by using `git config --get-urlmatch` with multiple
`http.extraheader`s set. I've been stumped that it still didn't
work correctly with my patch, only the last value was actually
ever returned. But in fact, current Git (tested with v2.11.0)
also fails to do so correctly and only lists the last value.

As such, I'd argue this is a separate issue. If you're not
opposed, I'd like to fix this in a separate patch series later on
(probably after Git Merge).

--- >8 ---
Subject: [PATCH] fixup! urlmatch: include host in urlmatch ranking

---
 urlmatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/urlmatch.c b/urlmatch.c
index 6c12f1a48..739a1a558 100644
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -587,7 +587,7 @@ int urlmatch_config_entry(const char *var, const char *value, void *cb)
 	if (!item->util) {
 		item->util = xcalloc(1, sizeof(matched));
 	} else {
-		if (cmp_matches(&matched, item->util) <= 0)
+		if (cmp_matches(&matched, item->util) < 0)
 			 /*
 			  * Our match is worse than the old one,
 			  * we cannot use it.
-- 
2.11.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  parent reply	other threads:[~2017-02-01 11:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 22:45 What's cooking in git.git (Jan 2017, #06; Tue, 31) Junio C Hamano
2017-02-01  0:21 ` [PATCH] color_parse_mem: allow empty color spec Jeff King
2017-02-01  1:19   ` Jacob Keller
2017-02-02  9:16   ` Duy Nguyen
2017-02-02 12:42     ` [PATCH] document behavior of empty color name Jeff King
2017-02-03  9:24       ` Duy Nguyen
2017-02-03 12:29         ` Jeff King
2017-02-03 18:12           ` Junio C Hamano
2017-02-04  0:49             ` Jeff King
2017-02-01 11:08 ` Patrick Steinhardt [this message]
2017-02-01 18:40   ` What's cooking in git.git (Jan 2017, #06; Tue, 31) 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=20170201110851.GA475@pks-pc \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=psteinhardt@elego.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.
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).