Re: On --depth=funny value
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 9, 2013, 05:19 UTC
- Message-ID
- <7vr4lv7x2u.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CACsJy8CA-a0=HqTY9heJBhPO4M5jyLk=tf253rRKCRuTWz5teg@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 9 quoted lines
> On Wed, Jan 9, 2013 at 9:53 AM, Junio C Hamano <gitster@pobox.com> wrote: > ... >> * We would like to update "clone --depth=1" to end up with a tip >> only repository, but let's not to touch "git fetch" (and "git >> clone") and make them send 0 over the wire when the command line >> tells them to use "--depth=1" (i.e. let's not do the "off-by-one" >> thing). > > You can't anyway. Depth 0 on the wire is considered invalid by upload-pack.
Yes, that is a good point that we say "if (0 < opt->depth) do the shallow thing" everywhere, so 0 is spcial in that sense.
Which suggests that if we wanted to, we could update the fetch side to do the off-by-one thing against the current upload-pack when the given depth is two or more, and still send 1 when depth=1. When talking with an updated upload-pack that advertises exact-shallow protocol extension, it can disable that off-by-one for all values of depth. That way, the updated client gets history of wrong depth only for --depth=1 when talking with the current upload-pack; all other cases, it will get history of correct depth.
Hmm?