Re: [PATCH] git clone depth of 0 not possible.
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jan 8, 2013, 07:33 UTC
- Message-ID
- <CACsJy8B0ftDDagTpO4wh-LsBOBy+BhwhV=H-68U246Lq4=Ssfw@mail.gmail.com>
- In-Reply-To
- <1357581996-17505-1-git-send-email-stefanbeller@googlemail.com>
On Tue, Jan 8, 2013 at 1:06 AM, Stefan Beller <stefanbeller@googlemail.com> wrote:
Show 11 quoted lines
> Currently it is not possible to have a shallow depth of > just 0, i.e. only one commit in that repository after cloning. > The minimum number of commits is 2, caused by depth=1. > > I had no good idea how to add this behavior to git clone as > the depth variable in git_transport_options struct (file transport.h) > uses value 0 for another meaning, so it would have need changes at > all places, where the transport options depth is being used > (e.g. fetch) > > So I documented the current behavior, see attached patch.
If we choose not to do the off-by-one topic Junio suggested elsewhere in the same thread, I think this document patch should be turned into code instead. Just reject --depth=0 with an explanation. Users who are hit by this will be caught without the need to read through the document.
-- Duy