Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Shrink wrap commit-ish Git URLs? #3347

Closed
donaldpipowitch opened this issue Apr 15, 2013 · 4 comments
Closed

Shrink wrap commit-ish Git URLs? #3347

donaldpipowitch opened this issue Apr 15, 2013 · 4 comments

Comments

@donaldpipowitch
Copy link

Hi *,

is it possible to shrink-wrap a commit-ish Git URL? Unless it is easier to create a private npm I think it is a lot easier to use private Git repos for internal developing, but some features npm modules offer are missing from Git repos like shrink wrapping semver tags. (At least as I know?) A special syntax to use shrink wrap on commit-ish Git URLs would be really helpful. Maybe something like git://github.com/user/project.git#{<0.1.0} resolves to the highest available semver-valid tag above 0.1.0 like git://github.com/user/project.git#v0.2.0 or git://github.com/user/project.git#0.2.0 (it seems that some developers prefer to prepend a v before the version number within tags).

What do you think?

@domenic
Copy link
Contributor

domenic commented Apr 16, 2013

Unfortunately (in my personal opinion) @isaacs has decided against this feature; see #3328.

@domenic domenic closed this as completed Apr 16, 2013
@donaldpipowitch
Copy link
Author

Thank you. I hope it will be easier to use private modules mixed with public npm modules in the future :(

@isaacs
Copy link
Contributor

isaacs commented Apr 25, 2013

is it possible to shrink-wrap a commit-ish Git URL?

When you shrinkwrap a git url, it'll resolve the commit-ish and make sure that installing from the shrinkwrap will always get exactly that commit. (Ie, if your dep is isaacs/node-glob#master then your shrinkwrapped install will get whatever actual commit it was at the time you shrinkwrapped it, even if the commit-ish ref pointer moves.)

A special syntax to use shrink wrap on commit-ish Git URLs would be really helpful

Yes, we have a syntax for specifying a commit-ish on git urls, and shrinkwrap will do the right thing with it: git://server.com/path/to/repo#commit-ish

If you have a branch named v0.2 then #v0.2 on the url will give you the latest commit on that branch. Anything you can pass to git checkout will work. If you have a tag v0.2.5 then #v0.2.5 on the url will give you that tag.

If what you're asking for is to have npm get a list of all the tags, sniff which ones look like they might be version numbers, and then handle >=0.2.5 <1.3.7 as if it's a commit-ish, then no, that is too complicated and not worth doing. Git already has branches.

@donaldpipowitch
Copy link
Author

If what you're asking for is to have npm get a list of all the tags, sniff which ones look like they might be version numbers, and then handle >=0.2.5 <1.3.7 as if it's a commit-ish.

Yeah, that is what I was looking for. Thanks for answering this, but it is sad, that this isn't possible.

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

No branches or pull requests

3 participants