Subject: Re: [PATCH] dir: use per-worktree repository ignore patterns upon request

From: "brian m. carlson" <[email-masked]>
Date: Fri, 24 Apr 2026 19:35:51 +0000

On 2026-04-24 at 17:09:19, D. Ben Knoble wrote:
> Today we have $GIT_DIR/info/exclude for the main worktree, but $(git
> rev-parse --git-dir)/info/exclude for secondary worktrees does not
> actually contribute to ignore specs; instead, secondary worktrees also
> use $GIT_COMMON_DIR/info/exclude.
> 
> Some users may prefer each worktree use its own ignore file; some may
> prefer both; some may prefer the current behavior.
> 
> Add, test, and document extensions.worktreeIgnore that controls which
> set of ignore files to use for worktrees.

I was wondering if we could make something like
`extensions.worktreeInfoFiles` or something and also make the
`info/attributes` (and maybe `info/sparse-checkout`) file used instead.
I think that would be somewhat better than having additional options
added on after the fact and be a little more generally applicable.

What do you think?  My apologies for not mentioning this sooner before
you'd already sent a patch.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA