From: Matthijs Kooijman <firstname.lastname@example.org> To: Junio C Hamano <email@example.com> Cc: Duy Nguyen <firstname.lastname@example.org>, Jonathan Nieder <email@example.com>, Stefan Beller <firstname.lastname@example.org>, email@example.com, Ralf.Wildenhues@gmx.de, firstname.lastname@example.org Subject: Re: [PATCH] git clone depth of 0 not possible. Date: Thu, 30 May 2013 10:23:22 +0200 [thread overview] Message-ID: <20130530082322.GW25742@login.drsnuggles.stderr.nl> (raw) In-Reply-To: <email@example.com> Hi Junio, On Tue, May 28, 2013 at 10:04:46AM -0700, Junio C Hamano wrote: > Matthijs Kooijman <firstname.lastname@example.org> writes: > > > Did you consider how to implement this? Looking at the code, it seems > > the "deepen" parameter in the wire protocol now means: > > - 0: Do not change anything about the shallowness (i.e., fetch > > everything from the shallow root to the tip). > > - > 0: Create new shallow commits at depth commits below the tip (so > > depth == 1 means tip and one below). > > - INFINITE_DEPTH (0x7fffffff): Remove all shallowness and fetch > > complete history. > > > > Given this, I'm not sure how one can express "fetch the tip and nothing > > below that", since depth == 0 already has a different meaning. > > Doing it "correctly" (in the shorter term) would involve: Given below suggestion, I take it you don't like what Jonathan proposed (changing the meaning of the deepen parameter in the protocol so that the server effectively decides how to interpret --depth)? > - adding a capability on the sending side "fixed-off-by-one-depth" > to the protocol, and teaching the sending side to advertise the > capability; > > - teaching the sending side to see if the new behaviour to fix > off-by-one is asked by the requestor, and stop at the correct > number of commits, not oversending one more. Otherwise retain > the old behaviour. We can implement these two in current git already, since they only add to the protocol, not break it in an incompatible manner, right? > - teaching the requestor that got --depth=N from the end user to > pay attention to the new capability in such a way that: > > - when talking to an old sender (i.e. without the off-by-one > fix), send N-1 for N greater than 1. Punt on N==1; > > - when talking to a fixed sender, ask to enable the capability, > and send N as is (including N==1). And these should wait for git2, since they change the meaning of the --depth parameter? Or is this change ok for current git as well? What do you mean by "punt" exactly? Show an error to the user, saying only depth >= 2 is supported? > In the longer term, I think we should introduce a better deepening > mechanism. Cf. Even when there will be a better deepening mechanism, the above is still useful (passing --depth=1 serves to get just a single commit without history, which is a distinct usecase from deepening the history of an existing shallow repository). In other words, I think the "improved deepening" and "fixed depth" should be complementary features. Gr. Matthijs
next prev parent reply other threads:[~2013-05-30 8:23 UTC|newest] Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-01-07 18:06 Stefan Beller 2013-01-07 18:06 ` [PATCH] Documentation on depth option in git clone Stefan Beller 2013-01-08 6:28 ` [PATCH] git clone depth of 0 not possible Jonathan Nieder 2013-01-08 6:54 ` Junio C Hamano 2013-01-08 7:36 ` Junio C Hamano 2013-01-08 8:19 ` Junio C Hamano 2013-01-08 14:28 ` Duy Nguyen 2013-01-08 14:32 ` Stefan Beller 2013-01-08 14:45 ` Duy Nguyen 2013-01-08 17:24 ` Junio C Hamano 2013-01-08 7:38 ` Duy Nguyen 2013-01-08 8:05 ` Junio C Hamano 2013-05-28 9:18 ` Matthijs Kooijman 2013-05-28 16:28 ` Jonathan Nieder 2013-05-28 16:31 ` Jonathan Nieder 2013-05-28 16:34 ` Matthijs Kooijman 2013-05-28 16:58 ` Jonathan Nieder 2013-05-28 17:04 ` Junio C Hamano 2013-05-30 8:23 ` Matthijs Kooijman [this message] 2013-06-02 19:14 ` Junio C Hamano 2013-07-09 13:35 ` Matthijs Kooijman 2013-07-11 10:57 ` Matthijs Kooijman 2013-07-11 11:25 ` [PATCH 1/3] upload-pack: Remove a piece of dead code Matthijs Kooijman 2013-07-11 11:25 ` [PATCH 2/3] upload-pack: Introduce new "fixed-off-by-one-depth" server feature Matthijs Kooijman 2013-07-11 11:25 ` [PATCH 3/3] fetch-pack: Request fixed-off-by-one-depth when available Matthijs Kooijman 2013-07-11 12:08 ` [PATCH 1/3] upload-pack: Remove a piece of dead code Duy Nguyen 2013-07-11 15:49 ` Junio C Hamano 2013-01-08 7:33 ` [PATCH] git clone depth of 0 not possible Duy Nguyen 2013-01-08 7:37 ` Junio C Hamano
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style List information: http://vger.kernel.org/majordomo-info.html * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20130530082322.GW25742@login.drsnuggles.stderr.nl \ --email@example.com \ --cc=Ralf.Wildenhues@gmx.de \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH] git clone depth of 0 not possible.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Code repositories for project(s) associated with this inbox: https://80x24.org/mirrors/git.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).