From 36fabde8edb0d21d9b048a1b1a410ba683fe316f Mon Sep 17 00:00:00 2001 From: SargeMonkey Date: Wed, 31 Jul 2019 15:31:08 -0700 Subject: [PATCH 1/2] Recognize urls of the form git+https://github.com/tj/commander.js.git These patterns are returned by npm registry, eg, http://registry.npmjs.com/commander where the protocols are bundled together. It would be nice if giturlparse could add this patterns too. --- giturlparse/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/giturlparse/parser.py b/giturlparse/parser.py index 62959a7..83e6813 100644 --- a/giturlparse/parser.py +++ b/giturlparse/parser.py @@ -36,7 +36,7 @@ ]) POSSIBLE_REGEXES = ( - re.compile(r'^(?Phttps?|git|ssh|rsync)\://' + re.compile(r'^((?Phttps?|git|ssh|rsync)\+*)+\://' r'(?:(?P.+)@)*' r'(?P[a-z0-9_.-]*)' r'[:/]*' From a3c643989abf5e0bd3867c46518e38250084e39f Mon Sep 17 00:00:00 2001 From: SargeMonkey Date: Wed, 31 Jul 2019 15:48:21 -0700 Subject: [PATCH 2/2] Make the pattern for + upto one times instead of unlimited Make the pattern for + upto one times instead of unlimited --- giturlparse/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/giturlparse/parser.py b/giturlparse/parser.py index 83e6813..6fc4918 100644 --- a/giturlparse/parser.py +++ b/giturlparse/parser.py @@ -36,7 +36,7 @@ ]) POSSIBLE_REGEXES = ( - re.compile(r'^((?Phttps?|git|ssh|rsync)\+*)+\://' + re.compile(r'^((?Phttps?|git|ssh|rsync)\+?)+\://' r'(?:(?P.+)@)*' r'(?P[a-z0-9_.-]*)' r'[:/]*'