Subject: Re: What is the reason behind not hiding git worktrees from git?

From: Michal Suchánek <[email-masked]>
Date: Tue, 30 Sep 2025 12:37:09 +0200

On Sat, Sep 27, 2025 at 09:08:44PM +0000, Jason Cho wrote:
> > It does not not show its own .git directory as untracked files
> > 
> > That can be seen as inconsistent.
> 
> Well, I see your point. Since the .git directory is from a git repo, the directory is ignored by git. Therefore, you want git to also ignore other items derived from the repo, including work trees.
> 
> However, this is a minor improvement and I suspect your proposed feature may have an unknown impact.

The impact is that the list of worktrees would have to be read to get
status. As status is not particularly cheap operation in any case I
would expect the problem to be minor.

> Anyway, what's your real use case? Do you really add hundreds of work trees within the same repo directory so that you hate to see them in git status?

What is the abstraction you are trying to propose here?

Or do you suggest to eschew any intelligible abstraction in favor of
(probably minor) implementation convenience?

Thanks

Michal