Hi Junio,

> While implementing the above, I noticed my fix now introduced an
> off-by-one error the other way. When investigating, I found this commit:
>       commit 682c7d2f1a2d1a5443777237450505738af2ff1a
>       Author: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
>       Date:   Fri Jan 11 16:05:47 2013 +0700
>           upload-pack: fix off-by-one depth calculation in shallow clone
>           get_shallow_commits() is used to determine the cut points at a given
>           depth (i.e. the number of commits in a chain that the user likes to
>           get). However we count current depth up to the commit "commit" but 
> we
>           do the cutting at its parents (i.e. current depth + 1). This makes
>           upload-pack always return one commit more than requested. This patch
>           fixes it.
>           Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
>           Signed-off-by: Junio C Hamano <gits...@pobox.com>
> Which actually seems to fix the off-by-one bug that is described in this
> thread, but without going through the hoops of preserving current
> behaviour for older git versions (that is, it makes behaviour dependent
> on server version instead of client version).
> Does this mean the discussion in this thread is meaningless, or is that
> commit not intended to be the final fix?
Looking more closely, I also see that the above change is already
released in 1.8.2 versions. Given that, I don't think it makes sense to
to still try to provide this capability to get backward compatible
behaviour, since this would cause a off-by-one error the other way when
talking to 1.8.2.x servers...

However, since I pretty much finished the code for this, I'll send over
the patches and let you decide wether to include them or not. If you
want to include them but they need to be changed in some way, just let
me know.

The first patch of the series should be merged regardless.


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to