On Thursday, March 28, 2013 at 21:33 EDT,
Sam Xiao <
sam.x...@gmail.com> wrote:
> Does shadow clone only gives you the master branch?
>
> What about branches?
By default --depth implies --single-branch, but you can change that
with --no-single-branch to have it fetch the top commit from each
branch. See git-clone(1).
(Note: Shallow, not shadow.)
> I tested:
>
> git init .
> git fetch ssh://gerrit.local:29418/sample refs/changes/21/14321/9
> --depth 1 && git format-patch -1 --stdout FETCH_HEAD > patch
>
> But it's not that much faster.
The --depth option for 'git fetch' doesn't mean the same thing as for
'git clone'. See git-fetch(1).
I'd hoped that a sequence of
git clone --depth 1 ...
git fetch ... refs/changes/X/Y
would work, but that doesn't appear to be the case.
Anyway, the feature you really want is in review and will be available
in Gerrit 2.7 (and you shouldn't have any problems cherry-picking it
to 2.6):
https://gerrit-review.googlesource.com/43948
--
Magnus Bäck
ba...@google.com