Re: Re: [PATCH v5] builtin/clone.c: add --reject-shallow option
flat view
From: lilinchao@oschina.cn <hidden>
Date: 2021-03-04 06:27:59
Hi, On Mon, 1 Mar 2021, lilinchao@oschina.cn wrote:quoted
quoted
@@ -1440,6 +1444,8 @@ static void receive_shallow_info(struct fetch_pack_args *args,* shallow. In v0, remote refs that reach these objects are * rejected (unless --update-shallow is set); do the same. */ + if (args->remote_shallow) + die("source repository is shallow, reject to clone.");I just found that Johannes Schindelin wrote a document 14 year ago in Documentation/technical/shallow.txt: "There are some unfinished ends of the whole shallow business: A special handling of a shallow upstream is needed. At some stage, upload-pack has to check if it sends a shallow commit, and it should send that information early (or fail, if the client does not support shallow repositories). There is no support at all for this in this patch series."Oh wow, what a blast from the past. I do agree that your patch is an improvement over the current situation.
Thanks. Glad to hear the voice from you, hope I can get some suggestions from you too, especially on the transport part.
Thanks, Johannesquoted
It seems that my patch can sovle his worry in some degree, and maybe we could warn client in fetch-pack stage, if we don't choose to reject shallow cloning. if (args->remote_shallow) die("source repository is shallow, reject to clone."); else warning("remote source repository is shallow.");