sourcegraph / srclib

srclib is a polyglot code analysis library, built for hackability. It consists of language analysis toolchains (currently for Go and Java, with Python, JavaScript, and Ruby in beta) with a common output format, and a CLI tool for running the analysis.
https://srclib.org
Other
942 stars 62 forks source link

Not all raw revspecs should be resolved to a VCS url #165

Open xizhao opened 9 years ago

xizhao commented 9 years ago

A release on a registry like npm is not guaranteed to be backed by any VCS nor will it always map to a VCS url. An NPM copy, for instance, should retain its revspec as an id and be considered a separate codebase, and the way to access it is just to download from a registry. Clone urls could look like npm://package@1.0.0.

Maybe we should add a new property of a repo called release_of that, if populated, marks a repo as a fork/release of another main repo. Any package, binary, or etc. version is considered a release.

Another change that makes sense to go with this is:

toCloneURL -> clone_cmd + clone_params

git://github.com/sourcegraph/srclib.git -> { clone_cmd: `git clone`, clone_params: `github.com/sourcegraph/srclib.git` }
https://npmjs.com/owner/package -> { clone_cmd: `npm fetch`, clone_params: `owner package` }
(curl && unzip may work too for files and tars)
xizhao commented 9 years ago

https://github.com/sourcegraph/srclib-javascript/issues/15

I think this a serious problem with how closely srclib is tied to git and resolving consistently to a vcs url. Anyone willing to pick this up with me?