codio / snr

Simple search and replace
3 stars 0 forks source link

Wrong file iterating #1

Closed destitutus closed 11 years ago

destitutus commented 11 years ago

case 1 - duplicates doc/test/test/test/test.txt:

snr -C 3 "Privet" -Q --max-result-count 501 "**/**"
doc/test/test/test/test.html
1:Privet
doc/test/test/test/test.txt
1:Privet
doc/test/test/test/test.html
1:Privet
doc/test/test/test/test.txt
1:Privet
doc/test/test/test/test.html
1:Privet
doc/test/test/test/test.txt
1:Privet
doc/test/test/test/test.html
1:Privet
doc/test/test/test/test.txt
1:Privet
doc/test/test/test/test.html
1:Privet
doc/test/test/test/test.txt
1:Privet
humans.txt
1-# humanstxt.org/
2-# The humans responsible & technology colophon
3-Прывет
4:Privet
5-# TEAM
6-
7-    <name> -- <role> -- <twitter>
Found 11 matches in 11 file(s).

case 2 - missed doc/test/test/test/test.txt:

snr -C 3 "Privet" -Q --max-result-count 501 "*"
doc/test/test/test/test.html
1:Privet
humans.txt
1-# humanstxt.org/
2-# The humans responsible & technology colophon
3-Прывет
4:Privet
5-# TEAM
6-
7-    <name> -- <role> -- <twitter>
Found 2 matches in 2 file(s).

zip for project was sent by email

dignifiedquire commented 11 years ago

Case 1

Wrong glob, it must be **/*.* to search in all files with all extensions:

dignifiedquire in ~/Downloads/test
$ snr -C 3 "Privet" -Q --max-result-count 501 "**/*.*"
doc/test/test/test/test.html
1:Privet
doc/test/test/test/test.txt
1:Privet
humans.txt
1-# humanstxt.org/
2-# The humans responsible & technology colophon
3-Прывет
4:Privet
5-# TEAM
6-
7-    <name> -- <role> -- <twitter>
Found 3 matches in 3 file(s).

Case 2

Can't reproduce (ack 2.04 on Mac OX 10.7)

dignifiedquire in ~/Downloads/test
$ snr -C 3 "Privet" -Q --max-result-count 501 "*"
doc/test/test/test/test.html
1:Privet
doc/test/test/test/test.txt
1:Privet
humans.txt
1-# humanstxt.org/
2-# The humans responsible & technology colophon
3-Прывет
4:Privet
5-# TEAM
6-
7-    <name> -- <role> -- <twitter>
Found 3 matches in 3 file(s).
dignifiedquire commented 11 years ago

Reproduced case2 with ack-grep 1.9.2. Looks like it's a problem with ack itself, so we either have to live with it or upgrade.

destitutus commented 11 years ago

so, we must use embeded ack version for search

dignifiedquire commented 11 years ago

Should be fixed in 0.2.0.