petejkim / goop

A simple dependency manager for Go (golang), inspired by Bundler.
MIT License
779 stars 45 forks source link

Detect VCS based on an URL. #26

Open vadimsht opened 10 years ago

vadimsht commented 10 years ago

Used when fetching dependencies from custom URLs.

Previously only package name was used for this, e.g. packages with names code.google.com/... are always fetched using Mercurial (if original repository on code.google.com is Mercurial), even though custom URL may point to a Git mirror.


Note that I decided not to use IdentifyVCS for this, since I dislike the idea of sending git or hg requests into the unknown. If GuessVCS fails to detect repository flavor, a default decision made by vcs.RepoRootForImportPathStatic is used as before.

(Also I find it curious that IdentifyVCS is defined and has a test, but not actually used).