-
Notifications
You must be signed in to change notification settings - Fork 357
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
help wanted: switch to ignore
crate for gitignore handling
#2499
Conversation
7dfe1a3
to
6632d9f
Compare
I added the test `test_gitignore_negative_parent_directory` which fails in our gitignore implementation but passes with the `ignore` implementation.
6632d9f
to
0a81f54
Compare
ignore
crate for gitignore handlingignore
crate for gitignore handling
ignore
crate for gitignore handlingignore
crate for gitignore handling
Tests are failing, e.g. https://github.com/martinvonz/jj/actions/runs/6727225092/job/18284735965?pr=2499, could use help on this |
I spent some time on this. I wonder if it's simply a bug in the $ echo ignored > .gitignore
$ echo test > ignored
$ rg test
ignored
1:test Does anyone else here have any experience with ripgrep? |
Use
|
Thanks! It does seem to ignore the files correctly in the case that's failing in this PR. So I guess we're not using the API correctly somehow. I'll see if can find more time to spend on it later. |
Speaking of .ignore - creator of ignore and ripgrep pushes the idea of a universal .ignore standard (which is basically just .gitignore I think, but just respected in contexts it has any meaning). It would be trivially easy to support both .ignore and .gitignore with the crate, and the idea imo is appealing. |
Ignore lib not support sibling ripgrep/issues/1909. So it might need to custom data structure to use multiple GitIgnore module. |
It sounds to me like we shouldn't be affected by that because we don't use the matcher on sibling directories. Or did you find a case where we do? |
+match with parent path. If i understand correctly comment on linked issue(ripgrep/issues/1909). fn test_gitignore_literal_with_prefix() {
let file = GitIgnoreFile::empty().chain("dir/", b"foo\n");
// I consider it undefined whether a file in a parent directory matches, but
// let's test it anyway
assert!(!file.matches("foo")); Can we ignore this cases? |
Ah.
I would say so. That comment (which I'm pretty sure I wrote once upon a time) seems quite clear in saying that it doesn't really matter what we do in that scenario. And I don't think we have any new cases where we have started depending on how it would behave. Thanks for checking. |
Okay i found other regression on other ambiguous pattern. I will left comment later. |
I don't personally care how you do it. I would simply say "Thanks to @arxanas who did most/some/whatever of the work on this patch.". Some people put footers like "Co-authored-by:" or something in the commit message. Maybe @arxanas has an opinion. |
I use |
Created new PR #3071. and summarized changed test cases. |
Checklist
If applicable:
CHANGELOG.md