git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Jeff King <peff@peff.net>
Cc: Jamey Sharp <jamey@minilop.net>,
	git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Johannes Sixt <johannes.sixt@telecom.at>,
	Junio C Hamano <gitster@pobox.com>,
	Josh Triplett <josh@joshtriplett.org>
Subject: Re: [PATCH v3 3/3] Add documentation for virtual repositories
Date: Thu, 26 May 2011 11:28:33 -0700	[thread overview]
Message-ID: <BANLkTimQO3AFeSmmFZOBLLGwEDgQk33Euw@mail.gmail.com> (raw)
In-Reply-To: <20110525171021.GA24038@sigill.intra.peff.net>

On Wed, May 25, 2011 at 10:10, Jeff King <peff@peff.net> wrote:
> Like chroots, there is a sticky point with symbolic links. What should
> "refs/virtual/repo1/HEAD" have in it? Either:
>
>  ref: refs/virtual/repo1/refs/heads/master
...
> If the former, then we will have to make sure the ref is inside our
> prefix, and strip it out.

Yes. And if its outside of our chroot space, we have to hide the
symbolic reference as though it is broken. This is fairly simple since
symbolic references are supposed to be "absolute", we can do a quick
prefix test and either strip the prefix on read (or add it on write),
or pretend like the reference is broken and hide it if its outside the
prefix.

> If the latter, then you will get different
> results for:
>
>  git show refs/virtual/repo1/HEAD
>
> versus
>
>  GIT_REF_PREFIX=refs/virtual/repo1 git show HEAD
>
> which I think is a bad thing.

Yes, I agree, this would be bad. Hence we should store the real path
in the symbolic reference, but strip/add the prefix when
GIT_REF_PREFIX is set.

-- 
Shawn.

  reply	other threads:[~2011-05-26 18:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25  0:46 [PATCH v3 1/3] Support multiple virtual repositories with a single object store and refs Jamey Sharp
2011-05-25  0:46 ` [PATCH v3 2/3] Support virtual repositories in smart http-backend, specified by environment Jamey Sharp
2011-05-25  0:46 ` [PATCH v3 3/3] Add documentation for virtual repositories Jamey Sharp
2011-05-25 16:07   ` Jeff King
2011-05-25 17:01     ` Shawn Pearce
2011-05-25 17:10       ` Jeff King
2011-05-26 18:28         ` Shawn Pearce [this message]
2011-05-25 17:20     ` Junio C Hamano
2011-05-25 18:03     ` Josh Triplett
2011-05-25  1:21 ` [PATCH v3 1/3] Support multiple virtual repositories with a single object store and refs Junio C Hamano
2011-05-25 16:08   ` Jamey Sharp

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=BANLkTimQO3AFeSmmFZOBLLGwEDgQk33Euw@mail.gmail.com \
    --to=spearce@spearce.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jamey@minilop.net \
    --cc=johannes.sixt@telecom.at \
    --cc=josh@joshtriplett.org \
    --cc=peff@peff.net \
    /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).