This PR enables the standalone testing of our git processes while installing from git (see also, but not only #4667 - Don't *always* fetch remote repositories of git-dependencies)
Don't *always* fetch remote repositories of git-dependencies
It also factors out almost the whole process of fetching tarballs from git into an own module.
I am happy to rebase/squash this, but as there were some refactoring I leave the single commits for an easier review.
Factor out getCacheStat
This is one of the first steps to factor out the git part of
`cache.js` into a separate module which can be tested separately.
use option-hash, fix missing rm
inject methods, remove gitDoneCb
@isaacs any opinion on that before the weekend starts?
sweet! factoring out the git-cache into its own module is very nice :)
actually factoring out the whole cache would be even more nice (npm depending on npm-cache depending on npm-git-cache).
This tentatively LGTM, assuming it rebases nicely. @isaacs?
So, I'm a bit leery about refactoring the cache folder into multiple modules without taking some time to think about where we're going. It runs the risk of not actually making things better, but just splitting the logic and data arbitrarily into multiple places. (Qv. npmconf module for why that can be somewhat awful, if not done carefully.)
This module is still tightly coupled to npm's very specific logic, and by being tightly coupled in multiple modules, it's even more difficult to change.
Rather than copy out the functions exactly as they are in npm's internals, it would be better, I think, to try to figure out what sort of general-purpose utility would have made npm's internals simpler, and then go build THAT thing.