Re: git clone combined with --depth, --branch and --single-branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 17, 2013 at 7:29 PM, Thibault Kruse
<tibokruse@xxxxxxxxxxxxxx> wrote:
> git log --pretty=format:'%h-%s %d' --graph --decorate  --all
> * 4565162-5  (foo)
> * 20ce846-4
> * a0615eb-3
> * fa4131d-2
> * f0683bd-1  (bar)
> | * 432b5ec-m1  (HEAD, master)
> |/
> * 39df203-0
>
> git clone repo1 repo2 --depth 1
> cd repo2
> git log --pretty=format:'%h-%s %d' --graph --decorate  --all
> * 432b5ec-m1  (HEAD, origin/master, origin/HEAD, master)
> * 39df203-0
>
> # Why are branches "foo" and "bar" missing?

--depth implies --single-branch. Without explicit --branch,
--single-branch will fetch HEAD. You need --no-single-branch to get
foo and bar.

> cd ..
> git clone repo1 repo3 --depth 1 --branch foo
> git log --pretty=format:'%h-%s %d' --graph --decorate  --all
> * 4565162-5  (HEAD, origin/foo, foo)
> * 20ce846-4
> * a0615eb-3
> * fa4131d-2
> * f0683bd-1
> | * 432b5ec-m1  (origin/master, origin/HEAD)
> |/
> * 39df203-0
>
> # Why is --depth not having effect, and why is branch bar not there,
> yet master is?

I'm not sure, but I can't reproduce it. There's an unreleased fix in
depth calculation (682c7d2 (upload-pack: fix off-by-one depth
calculation in shallow clone - 2013-01-11) that might affect this. You
may want to try again with "master". I got this with the same command

* edbd6cb (grafted, HEAD, origin/foo, foo) 5
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]