Is there enough interest/use-case for being able to specify gimme abcdef1234 to get a specific git sha and be able to do so repeatably, using cached builds rather than rebuilding each time?
If so, then this is a sketch of how we might do it:
Require a git new enough to support --reference
Maintain a bare repo at ~/.gimme/versions/go.git, use git fetch to update it
Whenever we build tip, or a specific SHA, resolve it first, then effectively do git clone --reference ~/.gimme/versions/go.git https://github.com/golang/go ~/.gimme/versions/ref.abcdef1234
Cache based on existence of that specific directory; resolve tip each time. This gives us working tip which updates but caches correctly
Have gimme update a log-file on each invocation, recording (timestamp, version)
Have gimme clean use the log-file to figure out any local version not used in the past two weeks (default) and nuke them.
There are problems with --reference but they relate to having one repo mapped into Docker but not the other repo. That should not be an issue with the internals of the gimme directory (and --dissociate is available if we really must bloat with redundant copies).
I'm tentatively willing to do this work, once 1.5.0 is out, as work for 1.6.0.
Is there enough interest/use-case for being able to specify
gimme abcdef1234
to get a specific git sha and be able to do so repeatably, using cached builds rather than rebuilding each time?If so, then this is a sketch of how we might do it:
git
new enough to support--reference
~/.gimme/versions/go.git
, usegit fetch
to update itgit clone --reference ~/.gimme/versions/go.git https://github.com/golang/go ~/.gimme/versions/ref.abcdef1234
tip
each time. This gives us workingtip
which updates but caches correctlygimme
update a log-file on each invocation, recording(timestamp, version)
gimme clean
use the log-file to figure out any local version not used in the past two weeks (default) and nuke them.There are problems with
--reference
but they relate to having one repo mapped into Docker but not the other repo. That should not be an issue with the internals of thegimme
directory (and--dissociate
is available if we really must bloat with redundant copies).I'm tentatively willing to do this work, once 1.5.0 is out, as work for 1.6.0.