We have some huge git repositories now and would like to use the depth option to not clone the whole history, but this does not work on multiple branches.
For example if we want to build a commit which is not reachable from HEAD (because it is in a different branch which exists in parallel to master) it fails because the revision could not be found.
There are basically two things which would make that usable:
1. Add a "Clone branch" option where one can define which branch should be cloned if "depth" is set (to something other than 0 which means it is disabled) and add that as "--branch <clone branch>" additionally to "--depth <depth>"
2. If "Clone branch" is empty add "--no-single-branch" (additionally to --depth) so that all commits can be reached and not just the history of HEAD.
I hope this makes clear what we need. If not, please just ask.
Thanks,
Alex
Description
Hi!
We have some huge git repositories now and would like to use the depth option to not clone the whole history, but this does not work on multiple branches.
For example if we want to build a commit which is not reachable from HEAD (because it is in a different branch which exists in parallel to master) it fails because the revision could not be found.
There are basically two things which would make that usable:
1. Add a "Clone branch" option where one can define which branch should be cloned if "depth" is set (to something other than 0 which means it is disabled) and add that as "--branch <clone branch>" additionally to "--depth <depth>"
2. If "Clone branch" is empty add "--no-single-branch" (additionally to --depth) so that all commits can be reached and not just the history of HEAD.
I hope this makes clear what we need. If not, please just ask.
Thanks,
Alex
I added a little drawing to maybe make it clearer.
If we want to build "branchcommit-1" it will fail if the "--depth" option is used.
With our solution (we know that one config will only build commits from a specified branch) we could either set the "Clone branch" to the branch name where "branchcommit-1" is located or set nothing and we still can reach "branchcommit-1" because the history (limited to depth) is available for all branches.
AlSt[30/Mar/18 12:52 PM]
I added a little drawing to maybe make it clearer.
If we want to build "branchcommit-1" it will fail if the "--depth" option is used.
With our solution (we know that one config will only build commits from a specified branch) we could either set the "Clone branch" to the branch name where "branchcommit-1" is located or set nothing and we still can reach "branchcommit-1" because the history (limited to depth) is available for all branches.
Only "--no-single-branch" is added as I do not want to add another configurable "clone branch" option to confuse users considering there is already a branch related setting
Robin Shen[22/Apr/18 12:13 PM]
Only "--no-single-branch" is added as I do not want to add another configurable "clone branch" option to confuse users considering there is already a branch related setting
If we want to build "branchcommit-1" it will fail if the "--depth" option is used.
With our solution (we know that one config will only build commits from a specified branch) we could either set the "Clone branch" to the branch name where "branchcommit-1" is located or set nothing and we still can reach "branchcommit-1" because the history (limited to depth) is available for all branches.