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

2.8.2 git shrinkwrap contains git+null #7961

Closed
KidkArolis opened this issue Apr 15, 2015 · 7 comments
Closed

2.8.2 git shrinkwrap contains git+null #7961

KidkArolis opened this issue Apr 15, 2015 · 7 comments
Labels

Comments

@KidkArolis
Copy link
Contributor

With 2.8.2, we've run npm install qubitdigital/ambassador --save && npm shrinkwrap and the shrinkwrap was updated to:

"ambassador": {
       "version": "1.0.0",
       "from": "qubitdigital/ambassador",
       "resolved": "git+null:[email protected]:qubitdigital/ambassador.git#a37f7f62fb1636cb0fe08fc65a233218a0fab334"
    }

Notice the git+null - that looks like it's incorrect.

@KidkArolis KidkArolis changed the title 2.8.2 git shrinkwrap 2.8.2 git shrinkwrap contains git+null Apr 15, 2015
@othiym23
Copy link
Contributor

That is definitely incorrect. It looks like hosted-git-info may be returning bogus SSH URLs in some cases. I'll take a look. Thanks!

@iarna
Copy link
Contributor

iarna commented Apr 15, 2015

wow,
git+null:[email protected]:qubitdigital/ambassador.git#a37f7f62fb1636cb0fe08fc65a233218a0fab334
is extra invalid.

It looks like 'git+' + protocol + ':' + info.ssh() and not 'info.sshurl()'

An actual valid URL would look like:

git+ssh://[email protected]/qubitdigital/ambassador.git#a37f7f62fb1636cb0fe08fc65a233218a0fab334

@iarna
Copy link
Contributor

iarna commented Apr 15, 2015

Ah, yup:

https://github.com/npm/npm/blob/master/lib/cache/add-remote-git.js#L87

Should be sshurl()

Which is then further mangled by:

https://github.com/npm/npm/blob/master/lib/cache/add-remote-git.js#L415-L419

To result in the confusing bit above.

@iarna iarna added the bug label Apr 15, 2015
@othiym23
Copy link
Contributor

Thanks for tracking that down, @iarna. For cloning purposes, npm needs .ssh(), but for saving purposes, is needs .sshurl() – it may be necessary to pass the parsed hostInfo all the way through, at least as far as getResolved. I'll investigate.

@othiym23
Copy link
Contributor

Fixed in 387f889. Thanks for bringing this up! This will be part of the next patch release, going out very soon (like, less than an hour).

@othiym23
Copy link
Contributor

...and indeed, this was included as part of [email protected].

@iarna
Copy link
Contributor

iarna commented Apr 16, 2015

For the record, just using sshurl proved to be insufficient, as sshurl now returns a git+ssh protocol and git only actually supports the ssh protocol and scp-style non-urls.

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

No branches or pull requests

4 participants
@KidkArolis @othiym23 @iarna and others