git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: John Koleszar <jkoleszar@google.com>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	git@vger.kernel.org, Shawn Pearce <spearce@spearce.org>
Subject: Re: [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients
Date: Thu, 4 Apr 2013 19:35:16 -0700	[thread overview]
Message-ID: <20130405023516.GA32290@leaf> (raw)
In-Reply-To: <CAAvHm8NyJ3nRZPygy+grMw5BLhLe8eWfEBNfK1tkC8Y34jRynA@mail.gmail.com>

On Thu, Apr 04, 2013 at 06:22:08PM -0700, John Koleszar wrote:
> On Thu, Apr 4, 2013 at 10:25 AM, Junio C Hamano <gitster@pobox.com> wrote:
> > John Koleszar <jkoleszar@google.com> writes:
> >
> >> @@ -402,7 +404,8 @@ static void get_info_refs(char *arg)
> >>
> >>       } else {
> >>               select_getanyfile();
> >> -             for_each_ref(show_text_ref, &buf);
> >> +             head_ref_namespaced(show_text_ref, &buf);
> >> +             for_each_namespaced_ref(show_text_ref, &buf);
> >>               send_strbuf("text/plain", &buf);
> >>       }
> >
> > Whether we are namespaced or not, we used to do for_each_ref() here,
> > not advertising the HEAD (outside refs/ hierarchy), but we now do,
> > and as the first element in the output.
> >
> > Am I reading the patch correctly?
> >
> > Is that an unrelated but useful bugfix even for people who do not
> > use server namespaces?
> >
> 
> Actually, I think this line may be buggy. Hold off submitting if you
> haven't already.
> 
> Including the HEAD ref in the advertisement from /info/refs ends up
> duplicating it, since the dumb client unconditionally fetches the file
> /HEAD to use as the that ref. I think the right thing to do is
> generate the correct /HEAD using head_ref_namespaced(), rather than
> returning the bare file $GIT_DIR/HEAD, but I'm not 100% sure how HEAD
> and namespaces interact, since I haven't been able to produce a repo
> with a different HEAD in a namespace. Can you verify this approach?

Semantically, every namespace should act like a completely independent
repository, which includes having its own independent HEAD.  A namespace
should *not* see the HEAD of the entire repository, only its own
namespaced HEAD.

Namespaces exist so that you can make a pile of repos share the same
object store while acting as independent repositories.  As long as you
never expose the un-namespaced repository, a client should not be able
to tell whether you use namespaces.

- Josh Triplett

  reply	other threads:[~2013-04-05  2:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28  4:58 [PATCH] http-backend: respect GIT_NAMESPACE with dumb clients John Koleszar
2013-03-28  6:02 ` Junio C Hamano
2013-03-28 15:49   ` Josh Triplett
2013-03-28 14:43 ` Junio C Hamano
     [not found]   ` <CAAvHm8NAqVHLz1wjNN-3ocpYzWfO-PDo0PAJ6pZO7KrMkhJ6Jw@mail.gmail.com>
2013-03-28 15:54     ` John Koleszar
2013-03-28 16:46       ` Junio C Hamano
2013-04-03 15:52       ` John Koleszar
2013-04-03 16:10         ` Jeff King
2013-04-03 16:16           ` Jeff King
2013-04-03 18:05             ` Junio C Hamano
2013-04-04 15:34               ` John Koleszar
2013-04-04 16:01                 ` John Koleszar
2013-04-04 17:25                   ` Junio C Hamano
2013-04-05  1:22                     ` John Koleszar
2013-04-05  2:35                       ` Josh Triplett [this message]
2013-04-05  2:56                         ` Jeff King
2013-04-05  5:34                           ` Junio C Hamano
2013-04-05  5:43                             ` Jeff King
2013-04-06  0:54                               ` John Koleszar
2013-04-10  0:55                                 ` [PATCH v4] " John Koleszar
2013-04-10  1:09                                   ` Junio C Hamano
2013-04-10  4:18                                   ` Jeff King
2013-04-08 21:25                   ` [PATCH] " Thomas Rast
2013-04-08 21:45                     ` Jeff King
2013-04-09 22:13                       ` John Koleszar
2013-04-03 18:04         ` 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=20130405023516.GA32290@leaf \
    --to=josh@joshtriplett.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jkoleszar@google.com \
    --cc=peff@peff.net \
    --cc=spearce@spearce.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).