Skip to content

chore(gitignore): ignore node_modules symlinks, not only directories - #897

Merged
iamtoruk merged 1 commit into
getagentseal:mainfrom
ozymandiashh:chore/gitignore-node-modules-symlink
Aug 4, 2026
Merged

chore(gitignore): ignore node_modules symlinks, not only directories#897
iamtoruk merged 1 commit into
getagentseal:mainfrom
ozymandiashh:chore/gitignore-node-modules-symlink

Conversation

@ozymandiashh

Copy link
Copy Markdown
Collaborator

Root-cause hardening for the incident #896 cleaned up. node_modules/ with the trailing slash ignores directories only; a node_modules SYMLINK - which is exactly what linked worktrees sharing one install carry - is not matched, so a git add -A in such a worktree committed one in db018f7 (mine, owning that), every later checkout materialized a self-referencing symlink on disk, and #896 had to remove the tracked entry. Dropping the slash makes the pattern cover files, directories and symlinks, so this class of accident is structurally impossible regardless of who runs what in which worktree.

The node_modules/ pattern (trailing slash) matches directories only. A
node_modules SYMLINK, standard in linked worktrees that share one install,
is not covered, which is how db018f7 accidentally committed one and every
subsequent checkout materialized a self-referencing symlink until c642787
removed it. Dropping the slash covers files, directories and symlinks.

@iamtoruk iamtoruk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct and low-risk. The slash form ignores directories only, so a node_modules symlink (linked worktrees sharing one install) slipped into git add -A; dropping the slash covers files, directories and symlinks, making that class of accident structurally impossible. Nothing named node_modules should ever be tracked, so there is no downside. Good to merge.

@iamtoruk
iamtoruk merged commit a704f95 into getagentseal:main Aug 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants