Re: What is the reason behind not hiding git worktrees from git?
- From
Michal Suchánek <msuchanek@suse.de>
- Date
- Oct 2, 2025, 08:38 UTC
- Message-ID
- <aN46GP7-yUfXB_lL@kitsune.suse.cz>
- In-Reply-To
- <xmqqms6az2a0.fsf@gitster.g>
On Wed, Oct 01, 2025 at 03:27:03PM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes: > > > skip over them when scanning the output. Moreover, I think this is the > > first time that we have (on the list, at least) heard a complaint > > about the "noise", which may suggest that this is a non-issue for most > > people, and that a warning telling people to avoid the practice would > > be unwelcome. > > Ah, different people guess different reasons out of the same > observation. My interpretation of this is the first time about the > complaint on "noise" was because everybody else would not even have > additional worktree in-tree.
I suppose a suggestion about not adding worktree in-tree in the add command description would be helpful to avoid the problem.
That's the part I would read if I wanted to learn about adding worktrees, and it has none of those examples you mention.
Show 9 quoted lines
> > Aside: It might be valuable to extend the documentation to add a > > discussion about hanging worktrees off of a bare repository. People do > > use such a workflow, and git-worktree officially supports it, but I > > don't think there is any in-project documentation which mentions it. > > Oh, that is an obvious thing to do, too, to attach "additional" > worktrees to a bare repository (which does not have the primary > worktree). I do not think anybody sane would add these worktrees > in-tree if the repository is bare, though.
That's exactly the part that is obvious only to people familiar with git internals, not people reading the documentation. And it's what is needed to create the side-by-side layout for people that want to use that.
Thanks
Michal