feature: allow to use local repo copy while cloning
When there is a local repo copy, we could reduce bandwidth usage with it:
git clone --reference
for newer git (somewhen after 2.7.4) the fillowing option only generates a warning when the repo is missing:
git clone --reference-if-able
Compared to --depth, this has the advantage of full history.
As other clone options (like --depth), this is a local config.
We could also keep the last copy of the repo. Then use --dissociate as option, because this copies the git objects.
For other vcs providers (hg, ...) this could be implemented by first cloning locally, then pulling from remote.
@SimonHeimberg Thanks!
https://github.com/Block8/PHPCI/pull/838
implementation mentioned above https://github.com/php-censor/php-censor/issues/114#issuecomment-324801286 handles the mirror repo automatically
- Maintaining a mirror is another possibility of course. This requires managing this mirror repo (create, pull into, delete when project deleted, ...).
- My original idea was to use a local repo which is around anyway, and to not pull into this one. This is probably not very useful when running several workers. (How is build output like coverage report referenced then anyway?)
- My 2nd idea is to always keep the latest build directory and use this as pull reference. (The number of builds to keep could be configurable.)
@SimonHeimberg Thank you for the detailed explanation.