From: Duy Nguyen Date: Tue, 08 Jan 2013 14:45:27 GMT Subject: Re: [PATCH] git clone depth of 0 not possible. Message-ID: In-Reply-To: <50EC2DE5.2050704@googlemail.com> On Tue, Jan 8, 2013 at 9:32 PM, Stefan Beller wrote: > On 01/08/2013 03:28 PM, Duy Nguyen wrote: >> On Tue, Jan 8, 2013 at 2:36 PM, Junio C Hamano wrote: >>> Speaking of --depth, I think in Git 2.0 we should fix the semantics >>> of "deepening" done with "git fetch". >> >> Speaking of 2.0, we should support depth per ref. Well we don't have >> to wait until 2.0 because we could just add shallow2 extension to the >> pack protocol. We should also apply depth to new refs when fetching >> them the first time. >> > > Would this mean I could do something along? > $ git clone --since v1.8.0 git://github.com/gitster/git.git > > So tags would be allowed as anchors? No. This is what I had in mind: git clone --branch=master --depth=2 git.git # get branch master with depth 2 git fetch --depth=10 origin next # get branch next with depth 10 # master's depth remains 2 git fetch origin # get (new) branch 'pu' with default depth 2 But your case is interesting. We could specify --depth=v1.8.0.. or even --depth=v1.8.0~200.. (200 commits before v1.8.0). Somebody may even go crazy and make --depth=v1.6.0..v1.8.0 work. --depth is probably not the right name anymore. Any SHA-1 would be allowed as anchor. But I think we need to wait for reachability bitmap feature to come first so that we can quickly verify the anchor is reachable from the public refs. -- Duy