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 #659

Closed
sedm0784 opened this issue Oct 30, 2017 · 4 comments
Closed
Labels
duplicate An issue that is duplicative of another.

Comments

@sedm0784
Copy link

sedm0784 commented Oct 30, 2017

In short, git treats paths with escaped spaces in the same way as paths with spaces. ripgrep 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. rg hi

Observed results:

ignore me
1:hi there

Expected results:

There should be no output, because ripgrep 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 ;).

@okdana
Copy link
Contributor

okdana commented Oct 30, 2017

Relevant: #526

I had a fix for this that seems to work fine on UNIX, but there are unresolved implications for Windows because rg supports \ as a directory separator on that platform

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
@BurntSushi
Copy link
Owner

Should we mark this as a duplicate of #526? I guess the user facing issue isn't quite the same, but I think they share the same resolution, right?

@okdana
Copy link
Contributor

okdana commented Oct 30, 2017

Seems right, yeah

@BurntSushi BurntSushi added the duplicate An issue that is duplicative of another. label Oct 30, 2017
@sedm0784
Copy link
Author

Yep, sorry. I didn't spot that one when I skimmed the existing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate An issue that is duplicative of another.
Projects
None yet
Development

No branches or pull requests

3 participants