git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 3/3] Add documentation for virtual repositories

From
Shawn Pearce <spearce@spearce.org>
Date
May 26, 2011, 18:28 UTC
Message-ID
<BANLkTimQO3AFeSmmFZOBLLGwEDgQk33Euw@mail.gmail.com>
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.

Show 10 quoted lines
> 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.
Previous: Jeff KingNext: Junio C Hamano
Message 7 of 11 in “Support multiple virtual repositories with a single object store and refs”
  1. 1/3 Support multiple virtual repositories with a single object store and refsJamey Sharp, May 25, 2011
  2. 2/3 Support virtual repositories in smart http-backend, specified by environmentJamey Sharp, May 25, 2011
  3. 3/3 Add documentation for virtual repositoriesJamey Sharp, May 25, 2011
  4. Jeff KingMay 25, 2011
  5. Shawn PearceMay 25, 2011
  6. Jeff KingMay 25, 2011
  7. Shawn PearceMay 26, 2011
  8. Junio C HamanoMay 25, 2011
  9. Josh TriplettMay 25, 2011
  10. Junio C HamanoMay 25, 2011
  11. Jamey SharpMay 25, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.