Skip to content

fix: match .git watch ignore by path segment - #926

Open
zengks wants to merge 1 commit into
fastify:mainfrom
zengks:codex/fix-548-git-watch-ignore
Open

zengks wants to merge 1 commit into
fastify:mainfrom
zengks:codex/fix-548-git-watch-ignore

Conversation

@zengks

@zengks zengks commented Oct 27, 2026 •

Copy link
Copy Markdown

The default .git ignore matches substrings anywhere in an absolute path. In directories such as fastify.git/main or ordinary.git, TypeScript recompiles but Fastify does not restart because the watcher ignores the app.

Match the literal .git entry as a complete path segment using POSIX or Windows separators. Git metadata files, directories, and descendants remain excluded. Other ignore tokens and custom regular expressions retain their existing behavior.

Add regression tests for metadata exclusion, similarly named directories, Windows drive and UNC paths, parsed TypeScript watch defaults, and custom expressions. Document the corrected behavior.

Fixes #548.

Validation

  • Full macOS suite passes on Node 24.22.1, including type checks and 100% coverage.
  • All 18 focused watcher tests pass on macOS and Linux.
  • Six real TypeScript reload scenarios pass on both platforms, including the two previously failing layouts.
  • Lint passes.
  • npm run benchmark --if-present succeeds; no benchmark script is defined.
  • Native Windows watching and the remaining CI matrix have not been verified locally.

Related: #925 changes build matching in the same helper. This change is limited to the literal .git token.

Checklist

  • run npm run test && npm run benchmark --if-present
  • tests and/or benchmarks are included
  • documentation is changed or added
  • Commit message and code follow the Developer’s Certificate of Origin and the Code of Conduct.

Signed-off-by: zengks <zengks@outlook.com>

This branch has not been deployed

No deployments
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.

watch mode not working with git worktree

1 participant