Re: [PATCH v3 3/3] Add documentation for virtual repositories
From: Shawn Pearce <hidden>
Date: 2016-06-15 22:51:20
On Wed, May 25, 2011 at 10:10, Jeff King [off-list ref] 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.