Microsoft VSTS git url parsing fails
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:[email protected]/MyFirstProject/_git/reponame'
>>> p = parse(vsts_url)
>>> p.host
'user:[email protected]/MyFirstProject'
>>> p.owner
'_git'
>>> p.repo
'reponame'
>>> p.domain
'user:[email protected]/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
Nice! I will try to find some time to work on this
~Came across this other Azure URL with giturlparse==1.2.2, and I think it's related to this thread so:~
Example of https://github.com/coala/git-url-parse
Edit: Oops wrong library.