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

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
Previous: David TurnerNext: Michael Haggerty
Message 9 of 24 in “refs: clean up common_list”
  1. 1/4 refs: clean up common_listDavid Turner, Aug 12, 2015
  2. 2/4 path: optimize common dir checkingDavid Turner, Aug 12, 2015
  3. Junio C HamanoAug 12, 2015
  4. Michael HaggertyAug 13, 2015
  5. Junio C HamanoAug 14, 2015
  6. David TurnerAug 14, 2015
  7. Junio C HamanoAug 14, 2015
  8. David TurnerAug 14, 2015
  9. Michael HaggertyAug 15, 2015
  10. Michael HaggertyAug 15, 2015
  11. Junio C HamanoAug 17, 2015
  12. Duy NguyenAug 15, 2015
  13. David TurnerAug 16, 2015
  14. Duy NguyenAug 16, 2015
  15. 3/4 refs: make refs/worktree/* per-worktreeDavid Turner, Aug 12, 2015
  16. Eric SunshineAug 13, 2015
  17. David TurnerAug 13, 2015
  18. Michael HaggertyAug 13, 2015
  19. David TurnerAug 13, 2015
  20. Michael HaggertyAug 14, 2015
  21. Junio C HamanoAug 14, 2015
  22. Duy NguyenAug 15, 2015
  23. 4/4 bisect: make bisection refs per-worktreeDavid Turner, Aug 12, 2015
  24. Duy NguyenAug 15, 2015

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.