Re: [PATCH] git clone depth of 0 not possible.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 8, 2013, 08:19 UTC
- Message-ID
- <7vobh0f5nc.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vd2xggm8a.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> I think we need a protocol update to fix this; instead of sending > "Now I want your tips and N commits behind it, please update my > shallow bottom accordingly", which creates the above by giving you Z > and 3 generations back and updates your cut-off point to W, the > receiving end should be able to ask "I have a shallow history that > cuts off at these commits. I want to get the history leading up to > your tips, and also deepen the history further back from my current > cut-off points by N commits", so that you would instead end up with > something like this: > > (you) > o---o---o---A---B---C---D---E---F---...---W---X---Y---Z > > That is, truly "deepen my history by 3". We could call that "git > fetch --deepen=3" or something.
I take that back. If you start from
Show 5 quoted lines
> (upstream) > ---o---o---o---A---B > > (you) > A---B
and you are interested in peeking the history a bit deeper, you should be able to ask "I have a shallow history that cuts off at these commits. I want my history deepened by N commits. I do not care where your current tips are, by the way." with
git fetch --deepen=3
and end up with
> (you) > o---o---o---A---B
without getting the new history leading to the updated tip at the upstream. If you want the new history leading to the updated tip, you can just say:
git fetch
without any --depth nor --deepen option to end up with:
> (you) > A---B---C---D---E---F---...---W---X---Y---Z
instead.