Sources to only stage what is required for building, omitting large parts of VCS history
In order to open the doors to caching build trees, and to staging in a build farm scenario over CAS, it is important to reduce the amount of data which is staged at build time.
This issue blocks #311 Ammend: as per comments, this issue no longer blocks #311)
Here is a list of things which must be completed:
Source API docs
The Source.stage()
API documentation must be sneakily enhanced to state that only the minimum amount of data must be staged.
This can mean reducing the amount of history in .git/
, or excluding completely the data in .bzr
for bzr
plugins.
git plugin
For git
plugins, we must allow build scripts to correctly run git describe
, because this is being used increasingly instead of statically committed versioning data in build scripts.
The Source.stage()
implementation must be fixed to only include:
- The latest tagged object
- All of the commits since the latest tagged object, up until the ref commit
If there are no tags, then only the ref
commit can be included, such that git describe --always
still works.
For Source.init_workspace()
, the full history must be included, and upstream repo origin adjusted to point to the real upstream URL.
The git
source plugin documentation should clearly state that this is what is going to happen for builds, and that builds using the git
source plugin cannot expect to have additional support from the .git/
subdirectory than just the strict minimum needed to satisfy git describe
bzr plugin
For bzr
plugin, just omit the .bzr
directory entirely at Source.stage()
time.
For Source.init_workspace()
, the full history must be included, and upstream repo origin adjusted to point to the real upstream URL.
The bzr
source plugin documentation should clearly state that this is what is going to happen for builds, and that builds using the bzr
source plugin do not have access to the .bzr/
subdirectory and revision history.