{"thread":{"id":"65545","subject":"Advice on per-worktree private gitignore?","startedAt":"2026-04-23T21:26:17Z","lastAt":"2026-04-23T21:57:02Z","messageCount":2,"participants":["D. Ben Knoble","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"542228","messageId":"CALnO6CCXmA+ATT7CuyWkU6P8qmLCCpMi5Ppr1c78s0heznpVyw@mail.gmail.com","threadId":"65545","inReplyTo":null,"subject":"Advice on per-worktree private gitignore?","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-04-23T21:26:05Z","receivedAt":"2026-04-23T21:26:17Z","isPatch":false,"body":"Today we have $GIT_DIR/info/exclude for the main worktree, but $(git\nrev-parse --git-dir)/info/exclude for secondary worktrees does not\nactually contribute to ignore specs.\n\nIs this a \"we never got around to implementing that\", an intentional\nomission, or something else? Since --git-dir is described as parsing\n$GIT_DIR, I would naturally combine that with the gitignore(1) manual\nto think that the worktree.git/info/exclude should work.\n\n(Currently it seems that main-worktree/.git/info/exclude applies to\nall worktrees, which may not be desirable in some circumstances.)\n\nThanks,\n-- \nD. Ben Knoble\n"},{"id":"542229","messageId":"aeqVpjPSyyvHDLWR@fruit.crustytoothpaste.net","threadId":"65545","inReplyTo":"CALnO6CCXmA+ATT7CuyWkU6P8qmLCCpMi5Ppr1c78s0heznpVyw@mail.gmail.com","subject":"Re: Advice on per-worktree private gitignore?","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-04-23T21:56:54Z","receivedAt":"2026-04-23T21:57:02Z","isPatch":false,"body":"On 2026-04-23 at 21:26:05, D. Ben Knoble wrote:\n> Today we have $GIT_DIR/info/exclude for the main worktree, but $(git\n> rev-parse --git-dir)/info/exclude for secondary worktrees does not\n> actually contribute to ignore specs.\n> \n> Is this a \"we never got around to implementing that\", an intentional\n> omission, or something else? Since --git-dir is described as parsing\n> $GIT_DIR, I would naturally combine that with the gitignore(1) manual\n> to think that the worktree.git/info/exclude should work.\n> \n> (Currently it seems that main-worktree/.git/info/exclude applies to\n> all worktrees, which may not be desirable in some circumstances.)\n\nI'm not aware of it being an intentional omission.  I think what you\nwant might be useful in some circumstances, but there also might be\ncircumstances where it's not wanted and the user might want the settings\nin the main worktree to be used everywhere.\n\nSo I'd say that we could add it as an optional extension, like\n`extensions.worktreeConfig`.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"}]}