Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft VSTS git url parsing fails #6

Open
makimat opened this issue Mar 9, 2018 · 2 comments
Open

Microsoft VSTS git url parsing fails #6

makimat opened this issue Mar 9, 2018 · 2 comments

Comments

@makimat
Copy link

makimat commented Mar 9, 2018

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

@yakky
Copy link
Member

yakky commented Mar 9, 2018

Nice! I will try to find some time to work on this

@gavindsouza
Copy link

gavindsouza commented Jan 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants