From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nicolas Pitre <nico@cam.org>,
Julian Phillips <julian@quantumfyre.co.uk>,
Daniel Barkalow <barkalow@iabervon.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
git@vger.kernel.org
Subject: Re: [PATCH] fix simple deepening of a repo
Date: Tue, 25 Aug 2009 08:14:24 -0700 [thread overview]
Message-ID: <20090825151424.GJ1033@spearce.org> (raw)
In-Reply-To: <7vy6p8pfm1.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> > The client knows the *name* of the ref, but not the SHA-1 the ref is
> > currently valued at. Thus when the client knows it wants a certain
> > ref by name, it needs to send a "want " line to the server that would
> > give it whatever that ref currently points at. Unfortunately since we
> > have not obtained that value yet, we are stuck.
>
> That could be something you can fix in the out-of-band procedure Gerrit
> uses (you let the client learn both name and value offline, and then the
> client uses that value on "want" line).
Well, we're trying to reduce out-of-band things with Gerrit.
Its bad enough that Gerrit doesn't use git am and git send-email
to slug around changes for discussion. As it is we're an island
among the git world, *despite* the fact that Gerrit speaks the git
protocol natively and you can push directly to it, avoiding the
send-email SMTP nonsense many folks run into.
> However, even if we limit the discussion to Gerrit, you would need an
> updated client that can be called with the out-of-band information
> (i.e. "we know that changes/88/4488/2 points at X, so use X when
> requesting") when talking with such an updated server.
Yes, exactly. Existing clients wouldn't send an arbitrary want
request, even if the server had a whitelist of objects it would
allow to be requested.
One reason why Gerrit publishes pending changes with ref names is to
make it easier for any user to obtain the proposed change locally.
Its hard to beat `git fetch URL blah`, that's even easier than
"save to mbox, git am mbox".
> So I think that expand-refs is a much nicer general solution than just
> "server side is configured to hide but still allow certain refs", and
> client updates cannot be avoided.
Yes, I agree. Given 20/20 hindsight, its the way the protocol
should have been implemented:
C: 0014expand refs/heads/*
C: 0013expand refs/tags/*
C: 0000
S: ...refs/heads/master
S: ...refs/heads/next
S: ...refs/tags/v1.0
S: 0000
This would have permitted clients doing `git pull URL for-linus` to say:
C: 0011expand for-linus
C: 0000
S: ...refs/heads/for-linus
S: ...refs/remotes/k26/for-linus
S: 0000
and thus significantly narrow the scope of what they are shown when
they connect for a given ref.
> > The problem with this is servers which are sending this expand-refs
> > tag have hidden certain namespaces from older clients. Those names
> > can't be seen by older git clients, unless the user does an upgrade.
>
> I do not think "generally hidden, but if you need to know you are allowed
> to peek" is much of a problem. You do not do that for regular refs, only
> for "on-demand-as-needed" type things. If we are going to make extensive
> use of notes on commits to give richer annotations, I suspect notes
> hierarchy could be hidden by default in a similar way.
After sleeping on it, I'm OK with hiding some refs from older clients.
Sometimes things evolve, and you should just update your software
to keep up with them. If you really want the "hidden refs" that
Gerrit advertises, you should install a newer client.
We could consider supporting a legacy option through upload-pack,
such as:
git fetch --upload-pack='git-upload-pack --expand refs/changes/' URL
which tells the remote side to additionally expand those refs during
the initial advertisement. Then users have an escape hatch if:
* They know the remote is new enough to hide refs;
* They suspect the remote is hiding refs;
* They received an out-of-band notification telling this;
* They have an older client which doesn't support expanding refs;
* They cannot upgrade said client yet;
I'm thinking about writing an RFC patch for this today for git.git.
I think the expand refs feature neatly solves a number of problems
for me in Gerrit. But I'm really hoping its not the only set of
repositories that would benefit from such a feature, because if so,
its not worth the headache of the protocol change.
--
Shawn.
next prev parent reply other threads:[~2009-08-25 15:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-22 5:52 git fetch --depth=* broken? Nicolas Pitre
2009-08-24 4:04 ` [PATCH] fix simple deepening of a repo Nicolas Pitre
2009-08-24 4:49 ` Junio C Hamano
2009-08-24 13:55 ` Nicolas Pitre
2009-08-24 14:20 ` Johan Herland
2009-08-24 22:21 ` Junio C Hamano
2009-08-24 16:26 ` Daniel Barkalow
2009-08-24 22:30 ` Julian Phillips
2009-08-25 0:18 ` Nicolas Pitre
2009-08-25 2:12 ` Shawn O. Pearce
2009-08-25 5:00 ` Sverre Rabbelier
2009-08-25 5:21 ` Junio C Hamano
2009-08-25 6:12 ` Shawn O. Pearce
2009-08-25 6:33 ` Junio C Hamano
2009-08-25 15:14 ` Shawn O. Pearce [this message]
2009-08-26 2:10 ` Shawn O. Pearce
2009-08-26 7:08 ` Johannes Sixt
2009-08-26 8:22 ` Shawn O. Pearce
2009-08-26 9:03 ` Junio C Hamano
2009-08-26 17:03 ` Shawn O. Pearce
2009-08-28 17:30 ` [RFC PATCH] upload-pack: expand capability advertises additional refs Shawn O. Pearce
2009-08-28 19:07 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090825151424.GJ1033@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=julian@quantumfyre.co.uk \
--cc=nico@cam.org \
/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).