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

Inconsistent interpretation of .gitignore #79

Closed
Geal opened this issue Sep 25, 2016 · 3 comments
Closed

Inconsistent interpretation of .gitignore #79

Geal opened this issue Sep 25, 2016 · 3 comments

Comments

@Geal
Copy link

Geal commented Sep 25, 2016

Hi!

First things first, great work on rg, it's amazingly fast :)

I got an issue with .gitignore usage, here's how you can reproduce:

  1. get a local clone of https://github.com/rust-lang/rust
  2. go in the src/ subdirectory
  3. With grep:
$ grep -nr "Index<Ran" .
./libcore/slice.rs:628:impl<T> ops::Index<RangeFull> for [T] {
./test/run-pass/slice.rs:23:impl Index<Range<Foo>> for Foo {
./test/run-pass/slice.rs:30:impl Index<RangeTo<Foo>> for Foo {
./test/run-pass/slice.rs:37:impl Index<RangeFrom<Foo>> for Foo {
./test/run-pass/slice.rs:44:impl Index<RangeFull> for Foo {
  1. With rg:
$ rg -n "Index<Ran" .
libcore/slice.rs
628:impl<T> ops::Index<RangeFull> for [T] {
  1. With rg --no-ignore:
$ rg --no-ignore -n "Index<Ran" .
libcore/slice.rs
628:impl<T> ops::Index<RangeFull> for [T] {

test/run-pass/slice.rs
23:impl Index<Range<Foo>> for Foo {
30:impl Index<RangeTo<Foo>> for Foo {
37:impl Index<RangeFrom<Foo>> for Foo {
44:impl Index<RangeFull> for Foo {

The .gitignore file contains /test/ at line 84 so rg should ignore <ROOT>/test/, not <ROOT>/src/test.

@BurntSushi
Copy link
Owner

This looks like a duplicate of some bugs I've fixed recently, specifically with respect to anchored patterns such as /test/. I'll get a new release out today. (Or you can try compiling master to confirm it is fixed.)

@BurntSushi
Copy link
Owner

I can indeed confirm that this is fixed in current master:

[andrew@Cheetah src] rg "Index<Ran"
test/run-pass/slice.rs
23:impl Index<Range<Foo>> for Foo {
30:impl Index<RangeTo<Foo>> for Foo {
37:impl Index<RangeFrom<Foo>> for Foo {
44:impl Index<RangeFull> for Foo {

libcore/slice.rs
621:impl<T> ops::Index<RangeFull> for [T] {

Specifically, this is a dupe of #25.

@Geal
Copy link
Author

Geal commented Sep 26, 2016

ok, thanks! I'll update.

On Sun, Sep 25, 2016 at 8:33 PM, Andrew Gallant notifications@github.com
wrote:

Closed #79 #79.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#79 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAHSADGr28KKGxoMs9MpJw8_9vfGARM7ks5qtr51gaJpZM4KF2zd
.

http://geoffroycouprie.com/

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

2 participants