-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
While using giturlparse with Microsoft VSTS git urls (visualstudio.com), I noticed the parser fails to detect them. They are a bit weird by syntax but git command line tools treat them well.
Example:
>>> from giturlparse import parse
>>> vsts_url = 'https://user:token@myteam.visualstudio.com/MyFirstProject/_git/reponame'
>>> p = parse(vsts_url)
>>> p.host
'user:token@myteam.visualstudio.com/MyFirstProject'
>>> p.owner
'_git'
>>> p.repo
'reponame'
>>> p.domain
'user:token@myteam.visualstudio.com/MyFirstProject'
>>> p.platform
'gitlab'If it's of any value, here's a regex that I use to match at least https-type VSTS urls. VSTS might provide other url types too.
re.compile('https:\/\/(?:.*@)?(?P<organization>[a-zA-Z0-9]+)\.visualstudio.com\/(?P<project>[^\/]*)\/_(?P<repotype>[^\/]*)\/(?P<repo>.*)')
Version: giturlparse==0.9.1