git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Carlos Martín Nieto" <cmn@elego.de>,
	git@vger.kernel.org, jrnieder@gmail.com, pclouds@gmail.com
Subject: Re: [PATCH 0/2] thin-pack capability for send-pack/receive-pack
Date: Wed, 6 Nov 2013 14:54:14 -0800	[thread overview]
Message-ID: <20131106225414.GA15920@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqvc056uc1.fsf@gitster.dls.corp.google.com>

On Wed, Nov 06, 2013 at 02:25:50PM -0800, Junio C Hamano wrote:

> > Support in the code isn't always enough. The particular case that
> > brought this on is one where the index-pack implementation can deal with
> > thin packs just fine.
> >
> > This particular service takes the pack which the client sent and does
> > post-processing on it to store it elsewhere. During the receive-pack
> > equivalent, there is no git object db that it can query for the missing
> > base objects. I realise this is pretty a unusual situation.
> 
> OK, I agree that it sounds quite niche-y, but it still is sensible.
> If a receiving end does not want to (this includes "it is incapable
> of doing so", but does not have to be limited to) complete a thin
> pack, the series will give it such an option in the longer term.

I wonder if we want to make the flag go in the opposite direction, then.

Right now we have no flag, and we assume the other side can handle a
thin pack. If we add a "thin" flag, then the timeline is roughly:

  1. Receive-pack starts advertising "thin".

  2. Send-pack cannot assume lack of "thin" means the other side cannot
     handle "thin" (it might just be an older receive-pack), and keeps
     sending thin packs.

  [time passes]

  3. Send-pack can safely assume that every server has learned "thin"
     and can assume that lack of "thin" means the server does not want a
     thin pack.

In other words, the benefit happens at step 3, and we do not get any
effect until some long assumption time passes.

If we instead introduced "no-thin", it is more like:

  1. Receive-pack starts advertising "no-thin" (as dictated by
     circumstances, as Carlos describes).

  2. Send-pack which does not understand no-thin will ignore it and send
     a thin pack. This is the same as now, and the same as step 2 above.

  3. An upgraded send-pack will understand no-thin and do as the server
     asks.

So an upgraded client and server can start cooperating immediately, and
we do not have to wait for the long assumption time to pass before
applying the second half.

It is tempting to think about a "thin" flag because that would be the
natural way to have implemented it from the very beginning. But it is
not the beginning, and the negative flag is the only way at this point
to say "if you understand this, please behave differently than we used
to" (because the status quo is "send a thin pack, whether I said it was
OK or not").

-Peff

  reply	other threads:[~2013-11-06 22:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06 15:04 [PATCH 0/2] thin-pack capability for send-pack/receive-pack Carlos Martín Nieto
2013-11-06 15:04 ` [PATCH 1/2] receive-pack: advertise thin-pack Carlos Martín Nieto
2013-11-06 15:04 ` [PATCH 2/2] send-pack: only send a thin pack if the server supports it Carlos Martín Nieto
2013-11-06 20:32 ` [PATCH 0/2] thin-pack capability for send-pack/receive-pack Junio C Hamano
2013-11-06 21:41   ` Carlos Martín Nieto
2013-11-06 22:25     ` Junio C Hamano
2013-11-06 22:54       ` Jeff King [this message]
2013-11-06 23:47         ` Shawn Pearce
2013-11-06 23:42     ` Shawn Pearce
2013-11-23 15:09       ` Carlos Martín Nieto

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131106225414.GA15920@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=pclouds@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).