From: Jeff King Date: Thu, 06 Feb 2014 19:42:59 GMT Subject: Re: [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap Message-ID: <20140206194249.GD14552@sigill.intra.peff.net> In-Reply-To: <1391699439-22781-7-git-send-email-pclouds@gmail.com> On Thu, Feb 06, 2014 at 10:10:39PM +0700, Nguyễn Thái Ngọc Duy wrote: > In smart http, upload-pack adds new shallow lines at the beginning of > each rpc response. Only shallow lines from the first rpc call are > useful. After that they are thrown away. It's designed this way > because upload-pack is stateless and has no idea when its shallow > lines are helpful or not. > > So after refs are negotiated with multi_ack_detailed and both sides > happy. The server sends "ACK obj-id ready", terminates the rpc call > and waits for the final rpc round. The client sends "done". The server > sends another response, which also has shallow lines at the beginning, > and the last "ACK obj-id" line. > > When no-done is active, the last round is cut out, the server sends > "ACK obj-id ready" and "ACK obj-id" in the same rpc > response. fetch-pack is updated to recognize this and not send > "done". However it still tries to consume shallow lines, which are > never sent. > > Update the code, make sure to skip consuming shallow lines when > no-done is enabled. Thanks for a nice explanation. > +# This test is tricky. We need large enough "have"s that fetch-pack > +# will put pkt-flush in between. Then we need a "have" the the server s/the the/the/ > +# does not have, it'll send "ACK %s ready" > +test_expect_success 'add more commits' ' > + ( > + cd shallow && > + for i in $(seq 10); do This probably needs to be test_seq for portability. -Peff