This repository was archived by the owner on Sep 9, 2020. It is now read-only.
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
Gracefully handle abbreviated revisions during import #987
Closed
Description
dep
in general frowns on / doesn't support abbreviated revisions. However during import, and when reading external config on-the-fly, dep shouldn't just give up. Instead we should lookup the full revision for the short revision, and use the full revision in the imported lock, etc.
I'm hoping that we can handle this in SourceMgr.InferConstraint
, so that all the importers get this for "free", though we probably need plumbing in gps to do the dirty work.
Notes:
- We already have
SourceMgr.RevisionPresentIn
to check if the revision is valid, and for the git implementation the underlying command used actually prints the full revision, but nothing exists right now to bubble that up. - Currently
InferConstraint
doesn't actually hit the repository to figure out if a rev is valid, it just matches a pattern. Since we actually validate tags/branches, it may be time to retire the guesswork, like doing length checks, and just reply on the source manager entirely to check if a string is a valid revision (and get the full revision if it was abbreviated).