vscode-spell-checker icon indicating copy to clipboard operation
vscode-spell-checker copied to clipboard

git worktree support for .gitignore

Open stevenliuakuna opened this issue 11 months ago • 2 comments

I have been using git worktrees with the following setup:

- outer_repository
  - .git (folder)
  - .gitignore
  - inner_repository 
  - worktrees
     - branch_1
        - inner_repository
           - .git (worktree pointer)
           - spellchecker_target

The outer_repository .gitignore contains /worktrees, which matches the spellchecker_target; however the spellchecker_target is not gitignored in inner_repository. However, vscode-spell-checker fails to check the file: File is exclude by .gitignore.

This works fine when I use a regular, non-worktree clone of the repository. But I would like to use worktree since my .git folder is rather huge.

stevenliuakuna avatar Mar 08 '24 01:03 stevenliuakuna

Looks like this repository uses cspell-gitignore to determine whether a file is gitignored. This package doesn't seem to stop when a .git file or directory is found, which is causing the issue.

Perhaps a better question is: why does gitignore determine whether or not we spellcheck files? Why not just spellcheck every file regardless of .gitignore?

acenturyandabit avatar Mar 19 '24 09:03 acenturyandabit

In fact there is a setting called useGitignore that you can turn off, which will fix your problem.

acenturyandabit avatar Mar 19 '24 09:03 acenturyandabit

Fair, thanks!

stevenliuakuna avatar Mar 25 '24 06:03 stevenliuakuna

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Apr 25 '24 05:04 github-actions[bot]