Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of .gitignore files with escaped spaces is inconsistent with git #1172

Open
sedm0784 opened this issue Oct 30, 2017 · 0 comments
Open

Comments

@sedm0784
Copy link

In short, git treats paths with escaped spaces in the same way as paths with spaces. The Silver Searcher doesn't.

Steps to reproduce:

  1. mkdir test_ignore
  2. cd test_ignore
  3. git init
  4. echo "hi there" > "ignore me"
  5. echo "ignore\\ me" >> .gitignore
  6. git status Note that the "ignore me" file is not listed.
  7. ag hi

Observed results:

ignore me
1:hi there

Expected results:

There should be no output, because the Silver Searcher should be ignoring the "ignore me" file.

I've just fixed my repo not to include the unnecessary escaping, so as far as I'm concerned this is pretty low priority ;).

sedm0784 added a commit to sedm0784/vimconfig that referenced this issue Oct 30, 2017
1. Use ripgrep over the Silver Searcher if it's installed.
2. Finally figured out the issue with .gitignore. I was
   backslash-escaping spaces in .gitignore, which works for git, but
   (currently) not for ripgrep or the Silver Searcher. Removing the
   unnecessary backslashes fixed the issue. Now I can finally :grep much
   faster than I :vimgrep, and use the external tools for much faster
   CtrlP-opening.

   I opened issues on the tools themselves:

   - BurntSushi/ripgrep#659
   - ggreer/the_silver_searcher#1172
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

No branches or pull requests

1 participant