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

Re: fixing workdirs

From
PHPierre Habouzit <madcoder@madism.org>
Date
Jul 19, 2010, 09:02 UTC
Message-ID
<20100719090248.GA10802@madism.org>
In-Reply-To
<7vy6dkl2d0.fsf@alter.siamese.dyndns.org>
On Fri, Jul 09, 2010 at 03:25:15PM -0700, Junio C Hamano wrote:
Show 27 quoted lines
> Pierre Habouzit <madcoder@madism.org> writes:
> 
> > On Thu, Jul 08, 2010 at 12:40:11PM -0700, Junio C Hamano wrote:
> >> Pierre Habouzit <madcoder@madism.org> writes:
> >> 
> >> > for the first one, the fix is simple: workdirs have now a name, and
> >> > their HEAD reflog lives in the "master" git repository reflog namespace
> >> > under logs/workdir/$workdir_name/HEAD. The workdir HEAD reflog is then a
> >> > symlink to the masters.
> >> 
> >> I think this is a sane thing to do, except for the "symlink" part but that
> >> would be just a minor implementation detail.
> >
> > What would you suggest instead of the symlink then ? (knowing that all
> > the workdir is just a full symlink farm at them moment).
> 
> I can imagine that we may want to have a general mechanism to help an
> object store that belongs to one "primary" repository be aware of ref-like
> things that live outside of the repoistory itself, and not just a special
> purpose hack suitable only to handle the workdirs.  E.g., we have talked
> about a "fork" created by "clone -s" wanting the forkee repository to be
> aware of its refs, so that rewinding the refs in the forkee repository and
> then running gc there won't remove the objects now unnecessary in the
> forkee but still needed by the forker repository.
> 
> It shouldn't be hard to do something similar to "gitdir: " support for
> this without using a symlink, no?
Sorry for the delay, I was on vacation.

Okay, I see, this makes sense. I'll see what I can do on this path, though it's probably harder than simply extending gitfiles. We still want a .git/ directory as we want most of the top level stuff to be local to each repository (HEAD, ORIG_HEAD, ...) but not:

  - subdirectories (most of them being references, logs, ...)
  - the lock (which is kind of the weak point in my proposal atm, yours
    is nicer)
  - config (or do we want a cascading semantics: local workdir config,
    master repository config, user .gitconfig, /etc/.... ? I think not
    but ...)
  - packed-refs

Plus, to make everything work, the reflogs of a given "workdir" (or shared clone) must be put in a different namespace to avoid clashes. Though this is probably the simplest bit.

All in all, I'm afraid to have to look at every single git script that for now writes without thinking twice under .git/ :/

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Junio C HamanoNext: Jan Hudec
Message 9 of 10 in “fixing workdirs”
  1. Pierre HabouzitJul 8, 2010
  2. TaitJul 8, 2010
  3. Joshua JensenJul 8, 2010
  4. Pierre HabouzitJul 9, 2010
  5. Junio C HamanoJul 8, 2010
  6. Avery PennarunJul 8, 2010
  7. Pierre HabouzitJul 9, 2010
  8. Junio C HamanoJul 9, 2010
  9. Pierre HabouzitJul 19, 2010
  10. Jan HudecAug 17, 2010

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.