Subject: Re: bug#79024: 31.0.50; Multiple working trees support for VC

From: Sean Whitton <[email-masked]>
Date: Fri, 25 Jul 2025 16:14:45 +0100

Hello,

On Fri 25 Jul 2025 at 10:53am -04, Spencer Baugh wrote:

> True, using "git worktree list" to implement this is of course slow.
> But my suggested implementation would be to simply read .git (which is a
> file rather than a directory in git worktrees); then the performance
> should be much better (just one file read).

Thought about this while running an errand after writing to you :)

Unfortunately though there are git worktrees implemented where .git is a
symlink to the relevant directory under .git/ in the main working tree
(git-annex does this), and there is something called GIT_COMMON_DIR,
which I just learned about, which affects worktree resolution.

Reading git-worktree(1) and gitrepository-layout(5), there's a lot of
implementation detail, which might change and vary across Git versions,
to try to reproduce in vc-git.el.  Whereas 'git worktree list' is a
stable interface.

-- 
Sean Whitton