Re: [PATCH v3 2/4] path: optimize common dir checking
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Aug 15, 2015, 18:20 UTC
- Message-ID
- <55CF82DB.8010204@alum.mit.edu>
- In-Reply-To
- <1439582644.8855.89.camel@twopensource.com>
On 08/14/2015 10:04 PM, David Turner wrote:
Show 14 quoted lines
> On Fri, 2015-08-14 at 10:04 -0700, Junio C Hamano wrote: >> [...] >> So I think we should have *three* functions: >> >> - git_workspace_name(void) returns some name that uniquely >> identifies the current workspace among the workspaces linked to >> the same repository. > > Random side note: the present workspace path name component is not > acceptable for this if alternate ref backends use a single db for > storage across all workspaces. That's because you might create a > workspace at foo, then manually rm -r it, and then create a new one also > named foo. The database wouldn't know about this series of events, and > would then have stale per-workspace refs for foo.
The reference backend should clearly have functions that are called on the creation and destruction of a workspace. In these functions the backend could initialize / clean up any reference-related resources associated with that workspace.
These functions can be empty for the filesystem backend.
Show 7 quoted lines
> That said, with my lmdb backend, I've been falling back to the files > backend for per-workspace refs. This also means I don't have to worry > about expiring per-workspace refs when a workspace is removed. > > I could change this, but IIRC, there are a fair number of things that > care about the existence of a file called HEAD, so the fallback was > easier. (That is, the other way was a giant hassle).
OK, so the functions can be empty for the lmdb backend, too :-)
Show 5 quoted lines
> [...] > For this patch series, I don't think we need to change anything [...] > Implementing > Junio's proposal would not affect this series; it would just be an > additional patch on top (or beforehand).
OK.
> [...]
Michael
-- Michael Haggerty mhagger@alum.mit.edu