From: Junio C Hamano <gitster@pobox.com>
To: "Johannes Löthberg" <johannes@kyriasis.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] upload-pack: Fail if cloning empty namespace
Date: Sat, 20 Jun 2015 14:20:24 -0700 [thread overview]
Message-ID: <xmqqmvzujcvb.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqqr3p6jltx.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Sat, 20 Jun 2015 11:06:50 -0700")
Junio C Hamano <gitster@pobox.com> writes:
>> You create a namespace by pushing to it,...
>
> You keep repeating that, but I do not think we agreed that it is the
> supported or correct procedure to set up a new namespace in the
> first place. Doesn't the server side need a lot more than just
> setting up HEAD symref (like running upload/receive-pack with the
> path to the hierarchy exported as GIT_NAMESPACE environment)?
Let me step back and try again, as I think I am missing some
existing feature you are using, and that missing piece is preventing
me from seeing why this is a good idea (by the way, I do not think
we are doing this exchange in the right thread---the upload-pack
patch is not about auto-vivifying a new namespace by creating HEAD).
I'll do a brief braindump which hopefully shows the basis of why I
keep saying that creating HEAD at random place is not sufficient.
Help me, by telling me what I am missing, understand why it is
sufficient.
Suppose we have a server at URL git://site.xz/r; it serves from the
filesystem, say /usr/share/git/r.git/ (bare repository). In that
directory, we have the usual HEAD, objects, refs/{heads,tags}, etc.
Further suppose we have there refs/namespaces/a/ under which HEAD,
refs/{heads,tags}, etc.
Then we run the server (say, git-daemon) with GIT_NAMESPACE
environment variable set to 'a'. The users can now run:
$ git clone git://site.xz/r
and they will see what's really under refs/namespaces/a/. The HEAD
they see is actually not /usr/share/git/r.git/HEAD but it is
/usr/share/git/r.git/refs/namespaces/a/HEAD. Everything outside
/usr/share/git/r.git/refs/namespaces/a is not visible to them.
In order to add a new namespace 'b' next to 'a', you would somehow
need to populate /usr/share/git/r.git/refs/namespaces/b. Presumably
you can prepare a source repository locally and then push everything
there manually, by doing something like this:
$ git push ssh://site.xz/usr/share/git/r.git refs/*:refs/namespaces/b/*
but we agree that this does not create refs/namespaces/b/HEAD.
But if we made some change to the transfer to push-to-receive-pack
so that this can also create HEAD that points at something, what
would the user say, instead of that earlier
$ git clone git://site.xz/r
to access this new namespace? Don't you have to be running another
instance of a server with GIT_NAMESPACE set to 'b'? How do you
arrange that to automagically happen?
Or do your users that clone/fetch do things differnetly from the
above, and if so what do they do?
How is your server configured to support the access the existing
namespace 'a', and the new namespace 'b' that is automatically
created by pointing /usr/share/git/r.git/refs/namespaces/b/HEAD
to one ref inside that namespace?
next prev parent reply other threads:[~2015-06-20 21:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-12 20:15 [PATCH/RFC] upload-pack: Fail if cloning empty namespace Johannes Löthberg
2015-06-12 21:01 ` Junio C Hamano
2015-06-12 22:17 ` [PATCH v2] " Johannes Löthberg
2015-06-12 22:32 ` Johannes Löthberg
2015-06-15 20:49 ` Junio C Hamano
2015-06-20 14:27 ` Johannes Löthberg
2015-06-20 18:06 ` Junio C Hamano
2015-06-20 18:13 ` Johannes Löthberg
2015-06-20 21:20 ` Junio C Hamano [this message]
2015-06-20 21:49 ` Johannes Löthberg
2015-06-21 18:43 ` 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=xmqqmvzujcvb.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johannes@kyriasis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.