Re: [PATCH] git clone depth of 0 not possible.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 8, 2013, 08:05 UTC
- Message-ID
- <7vvcb8f6aw.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CACsJy8D9+KHT=YfU0+rPCbs+AwxQOpfKzPChDhk8d-MMkRzZug@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 17 quoted lines
> On Tue, Jan 8, 2013 at 1:54 PM, Junio C Hamano <gitster@pobox.com> wrote: >>> Sounds buggy. Would anything break if we were to make --depth=1 mean >>> "1 deep, including the tip commit"? >> >> As long as we do not change the meaning of the "shallow" count going >> over the wire (i.e. the number we receive from the user will be >> fudged, so that user's "depth 1" that used to mean "the tip and one >> behind it" is expressed as "depth 2" at the end-user level, and we >> send over the wire the number that corresponded to the old "depth >> 1"), I do not think anything will break, and then --depth=0 may >> magically start meaning "only the tip; its immediate parents will >> not be transferred and recorded as the shallow boundary in the >> receiving repository". > > I'd rather we reserve 0 for unlimited fetch, something we haven't done > so far [1]. And because "unlimited clone" with --depth does not make > sense, --depth=0 should be rejected by git-clone.
I actually was thinking about changing --depth=1 to mean "the tip, with zero commits behind it" (and that was consistent with my description of "fudging"), but ended up saying "--depth=0" by mistake. I too think "--depth=0" or "--depth<0" does not make sense, so we are in agreement.
Thanks for a sanity check.