- changed status to open
- removed comment
shallow checkouts do not work with branches
Currently using both --shallow and a branch (rather than master) fails since GetComponents wants to first clone the full repo then switch to the requested branch which fails with a shallow clone.
However newer versions of git (>=1.7) support a "-b" (branch) option for clone and that one works fine even with shallow clones.
My recollection is that we could not use this method initially since there were clusters around that only offered git 1.6 (queenbee likely). This is no longer the case and all clusters in simfactory offer at least git 1.7.
This pull request:
https://github.com/gridaphobe/CRL/pull/6/files
both fixes the problem and simplifies the code.
Keyword:
Comments (5)
-
reporter -
- removed comment
As far as I can see, the patch only removes the branch functionality. It doesn't move it to the regular checkout (it doesn't add the mentioned "-b" option there). Wouldn't that leave shallow clones of branches still in master?
-
reporter - changed status to open
- removed comment
Hello Frank,
correct. Must have removed it with some other debug code. Will update.
Yours, Roland
-
reporter Hackathon task. Easy if we can assume git >= 1.7 on all clusters (it’s from 2010, https://en.wikipedia.org/wiki/Git#Releases). Namely, take my (faulty) commit that removes the current branch logic (which is fragile) and replace by a
git clone -b "foo"
is branch “foo” is requested.
This may also have the effect of fixing #2580 since there will no longer be a reference to “master” as the default branch in the repo.
-
- edited description
- changed status to resolved
Now git clone combines the use of --depth 1, --branch, and --single-branch
- Log in to comment