-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support npm-style #ref suffix; fixes issue 16 #17
Conversation
53a4b75
to
89e93af
Compare
It's an open question whether the last commit should be included. It's also an open question whether branch should default to None or to "master". The code I'm writing that uses this now looks like
|
Why would we be parsing npm urls? |
'ref': None, | ||
}, | ||
# npm and others allow specifying a branch or commit. See | ||
# https://docs.npmjs.com/files/package.json#git-urls-as-dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would this ever be used? https://docs.npmjs.com/files/package.json#git-urls-as-dependencies
? Thats an NPM url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just an example of one project that uses the convention. yarn uses it, too.
I've been using it in my scripts to configure buildbot, and I find it useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, it's not that much code to do without this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but npm isnt a git url neither are yarn urls. I have not seen a git url having this format so I would have a hard time accepting a PR like this bc it's outside the scope of the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a useful convention even outside of npm, but it's easy to implement as a tiny wrapper around git-url-parse, so closing.
Also save one call to re.search().