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

From: Ben Knoble <[email-masked]>
Date: Wed, 1 Oct 2025 22:33:56 -0400

> Le 1 oct. 2025 à 14:54, Junio C Hamano <[email-masked]> a écrit :
> 
> Ben Knoble <[email-masked]> writes:
> 
>>> 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.
>> 
>> I believe status information is used for the shell prompt info, so
>> performance hits there have a cost.
> 
> Sure, but an embedded git-controlled working tree _should_ be
> flagged as an untracked entity, _unless_ it is ignore'd, no?

Sorry, I’m not disagreeing with that here? Merely pointing out if that proposed changes affect git-status performance for the worse I will be disappointed :)

> That is how you would add a new submodule to your project after all.
> So, if you want to ignore them, just add them to .git/info/exclude
> or something, perhaps?
> 
> Why do people even want to have such a layout, unless they want to
> make it a submodule (or deliberate subdirectory that is unrelated)?

[snip: a better way]

Yep, I agree that’s easier, but I shouldn’t judge other’s workflows (I do it all the time 😅).