Git development
 help / color / mirror / Atom feed
* Advice on per-worktree private gitignore?
@ 2026-04-23 21:26 D. Ben Knoble
  2026-04-23 21:56 ` brian m. carlson
  0 siblings, 1 reply; 2+ messages in thread
From: D. Ben Knoble @ 2026-04-23 21:26 UTC (permalink / raw)
  To: Git

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.

Is this a "we never got around to implementing that", an intentional
omission, or something else? Since --git-dir is described as parsing
$GIT_DIR, I would naturally combine that with the gitignore(1) manual
to think that the worktree.git/info/exclude should work.

(Currently it seems that main-worktree/.git/info/exclude applies to
all worktrees, which may not be desirable in some circumstances.)

Thanks,
-- 
D. Ben Knoble

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Advice on per-worktree private gitignore?
  2026-04-23 21:26 Advice on per-worktree private gitignore? D. Ben Knoble
@ 2026-04-23 21:56 ` brian m. carlson
  0 siblings, 0 replies; 2+ messages in thread
From: brian m. carlson @ 2026-04-23 21:56 UTC (permalink / raw)
  To: D. Ben Knoble; +Cc: Git

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

On 2026-04-23 at 21:26:05, 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.
> 
> Is this a "we never got around to implementing that", an intentional
> omission, or something else? Since --git-dir is described as parsing
> $GIT_DIR, I would naturally combine that with the gitignore(1) manual
> to think that the worktree.git/info/exclude should work.
> 
> (Currently it seems that main-worktree/.git/info/exclude applies to
> all worktrees, which may not be desirable in some circumstances.)

I'm not aware of it being an intentional omission.  I think what you
want might be useful in some circumstances, but there also might be
circumstances where it's not wanted and the user might want the settings
in the main worktree to be used everywhere.

So I'd say that we could add it as an optional extension, like
`extensions.worktreeConfig`.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-23 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23 21:26 Advice on per-worktree private gitignore? D. Ben Knoble
2026-04-23 21:56 ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox