Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <patrick.steinhardt@elego.de>2017-01-31 12:01:46 +0300
committerJunio C Hamano <gitster@pobox.com>2017-02-02 00:22:46 +0300
commitaf99049ca92f5a5d16d8cce9727b859ac5c9ee00 (patch)
tree3655f0cd45b462fabd72f4291eb31d7e34f00f6f /urlmatch.h
parent3ec6e6e8a0870a32357689e2179d845700539623 (diff)
urlmatch: include host in urlmatch ranking
In order to be able to rank positive matches by `urlmatch`, we inspect the path length and user part to decide whether a match is better than another match. As all other parts are matched exactly between both URLs, this is the correct thing to do right now. In the future, though, we want to introduce wild cards for the domain part. When doing this, it does not make sense anymore to only compare the path lengths. Instead, we also want to compare the domain lengths to determine which of both URLs matches the host part more closely. Signed-off-by: Patrick Steinhardt <patrick.steinhardt@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'urlmatch.h')
-rw-r--r--urlmatch.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/urlmatch.h b/urlmatch.h
index 0ea812b03a..37ee5da85e 100644
--- a/urlmatch.h
+++ b/urlmatch.h
@@ -34,7 +34,8 @@ struct url_info {
extern char *url_normalize(const char *, struct url_info *);
struct urlmatch_item {
- size_t matched_len;
+ size_t hostmatch_len;
+ size_t pathmatch_len;
char user_matched;
};