Hello community, here is the log from the commit of package ack for openSUSE:Factory checked in at 2016-02-07 09:22:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ack (Old) and /work/SRC/openSUSE:Factory/.ack.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ack" Changes: -------- --- /work/SRC/openSUSE:Factory/ack/ack.changes 2015-02-27 11:00:36.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ack.new/ack.changes 2016-02-07 09:22:55.000000000 +0100 @@ -1,0 +2,9 @@ +Thu Feb 4 10:52:26 UTC 2016 - idon...@suse.com + +- ack 2.15_02 +- Bug fixes: + * Reverted an optimization to make \s work properly again +- Enhancements: + * The JSP filetype (--jsp) now recognizes .jspf files. + +------------------------------------------------------------------- Old: ---- ack-2.15_01.tar.gz New: ---- ack-2.15_02.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ack.spec ++++++ --- /var/tmp/diff_new_pack.SF0HjH/_old 2016-02-07 09:22:55.000000000 +0100 +++ /var/tmp/diff_new_pack.SF0HjH/_new 2016-02-07 09:22:55.000000000 +0100 @@ -23,7 +23,7 @@ %define with_pod 0 %endif Name: ack -Version: 2.15_01 +Version: 2.15_02 Release: 0 Summary: Grep-Like Text Finder License: Artistic-2.0 ++++++ ack-2.15_01.tar.gz -> ack-2.15_02.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/Ack.pm new/ack-2.15_02/Ack.pm --- old/ack-2.15_01/Ack.pm 2015-02-13 23:27:05.000000000 +0100 +++ new/ack-2.15_02/Ack.pm 2015-12-17 22:59:10.000000000 +0100 @@ -9,14 +9,14 @@ =head1 VERSION -Version 2.15_01 +Version 2.15_02 =cut our $VERSION; our $COPYRIGHT; BEGIN { - $VERSION = '2.15_01'; + $VERSION = '2.15_02'; $COPYRIGHT = 'Copyright 2005-2015 Andy Lester.'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/CONTRIBUTING.md new/ack-2.15_02/CONTRIBUTING.md --- old/ack-2.15_01/CONTRIBUTING.md 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/CONTRIBUTING.md 2015-12-17 22:59:10.000000000 +0100 @@ -2,6 +2,17 @@ Before you report an issue, please consult the [FAQ](http://beyondgrep.com/documentation/ack-2.12-man.html#faq). +# Asking to add a new filetype, or any enhancement + +From the man page: + +> All enhancement requests MUST first be posted to the ack-users mailing list at <http://groups.google.com/group/ack-users>. I will not consider a request without it first getting seen by other ack users. This includes +> requests for new filetypes. +> +> There is a list of enhancements I want to make to ack in the ack issues list at Github: <https://github.com/petdance/ack2/issues> +> +> Patches are always welcome, but patches with tests get the most attention. + # Reporting an Issue If you have an issue with ack, please add the following to your ticket: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/Changes new/ack-2.15_02/Changes --- old/ack-2.15_01/Changes 2015-02-13 23:23:59.000000000 +0100 +++ new/ack-2.15_02/Changes 2015-12-17 22:59:10.000000000 +0100 @@ -1,5 +1,27 @@ History file for ack. http://beyondgrep.com/ +2.15_02 Thu Dec 17 15:51:15 CST 2015 +==================================== +This is the first dev version in nine months. Many changes have gone +into this, probably more than have been listed here. We need to update +this list, but for now these are fixes we know are in here. My apologies +for not having this changelog accurate. + +[FIXES] +Reverted an optimization to make \s work properly again. (GH #572, +GH #571, GH #562, GH #491, GH #498) + +Fixed an out-of-date FAQ entry. Thanks, Jakub Wilk. (GH #580) + +[ENHANCEMENTS] +The JSP filetype (--jsp) now recognizes .jspf files. Thanks, Sebastien +Feugere. (GH #586) + +[INTERNALS] +Added test to make sure subdirs of target subdirs are ignored if +--ignore-dir applies to them. Thanks, Pete Houston. (GH #570) + + 2.15_01 Fri Feb 13 16:23:54 CST 2015 ==================================== [FIXES] @@ -11,6 +33,11 @@ Add minimal requirement of Getopt::Long 2.38, not 2.35, for GetOptionsFromString. +Don't ignore directories that are specified as command line targets (GH #524) + +Fix a bug where a regular expression that matches the empty string could cause ack +to go into an infinite loop (GH #542) + [ENHANCEMENTS] Many optimizations and code cleanups. Thanks, Stephan Hohe. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/ConfigDefault.pm new/ack-2.15_02/ConfigDefault.pm --- old/ack-2.15_01/ConfigDefault.pm 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/ConfigDefault.pm 2015-12-17 22:59:10.000000000 +0100 @@ -283,7 +283,7 @@ # JSP # http://www.oracle.com/technetwork/java/javaee/jsp/index.html ---type-add=jsp:ext:jsp,jspx,jhtm,jhtml +--type-add=jsp:ext:jsp,jspx,jspf,jhtm,jhtml # JSON # http://www.json.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/ConfigLoader.pm new/ack-2.15_02/ConfigLoader.pm --- old/ack-2.15_01/ConfigLoader.pm 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/ConfigLoader.pm 2015-12-17 22:59:10.000000000 +0100 @@ -9,7 +9,7 @@ use App::Ack::Filter; use App::Ack::Filter::Default; use Carp 1.04 (); -use Getopt::Long 2.35 (); +use Getopt::Long 2.38 (); use Text::ParseWords 3.1 (); =head1 FUNCTIONS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/MANIFEST new/ack-2.15_02/MANIFEST --- old/ack-2.15_01/MANIFEST 2015-02-14 00:00:15.000000000 +0100 +++ new/ack-2.15_02/MANIFEST 2015-12-17 23:01:13.000000000 +0100 @@ -99,6 +99,8 @@ t/issue276.t t/issue491.t t/issue522.t +t/issue562.t +t/issue571.t t/longopts.t t/lua-shebang.t t/match-filter.t @@ -226,6 +228,7 @@ t/swamp/service.svc t/swamp/solution8.tar t/swamp/stuff.cmake +t/swamp/swamp/ignoreme.txt t/text/4th-of-july.txt t/text/boy-named-sue.txt t/text/freedom-of-choice.txt @@ -237,4 +240,5 @@ xt/man.t xt/pod.t -META.yml Module meta-data (added by MakeMaker) +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/META.json new/ack-2.15_02/META.json --- old/ack-2.15_01/META.json 1970-01-01 01:00:00.000000000 +0100 +++ new/ack-2.15_02/META.json 2015-12-17 23:01:13.000000000 +0100 @@ -0,0 +1,67 @@ +{ + "abstract" : "A grep-like program for searching source code", + "author" : [ + "Andy Lester <a...@petdance.com>" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150001", + "license" : [ + "artistic_2" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "ack", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "Carp" : "1.04", + "Cwd" : "3.00", + "File::Basename" : "1.00015", + "File::Glob" : "1.00015", + "File::Next" : "1.10", + "File::Spec" : "3.00", + "File::Temp" : "0.19", + "Getopt::Long" : "2.38", + "Pod::Usage" : "1.26", + "Term::ANSIColor" : "1.10", + "Test::Harness" : "2.50", + "Test::More" : "0.98", + "Text::ParseWords" : "3.1", + "perl" : "5.008008" + } + } + }, + "release_status" : "testing", + "resources" : { + "bugtracker" : { + "web" : "http://github.com/petdance/ack2" + }, + "homepage" : "http://beyondgrep.com/", + "license" : [ + "http://www.perlfoundation.org/artistic_license_2_0" + ], + "repository" : { + "url" : "git://github.com/petdance/ack2.git" + }, + "x_MailingList" : "http://groups.google.com/group/ack-users" + }, + "version" : "2.15_02" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/META.yml new/ack-2.15_02/META.yml --- old/ack-2.15_01/META.yml 2015-02-14 00:00:15.000000000 +0100 +++ new/ack-2.15_02/META.yml 2015-12-17 23:01:12.000000000 +0100 @@ -1,41 +1,41 @@ ---- #YAML:1.0 -name: ack -version: 2.15_01 -abstract: A grep-like program for searching source code +--- +abstract: 'A grep-like program for searching source code' author: - - Andy Lester <a...@petdance.com> -license: unknown -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 + - 'Andy Lester <a...@petdance.com>' build_requires: - ExtUtils::MakeMaker: 0 + ExtUtils::MakeMaker: '0' +configure_requires: + ExtUtils::MakeMaker: '0' +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150001' +license: artistic_2 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: ack +no_index: + directory: + - t + - inc requires: - Carp: 1.04 - Cwd: 3.00 - File::Basename: 1.00015 - File::Glob: 1.00015 - File::Next: 1.10 - File::Spec: 3.00 - File::Temp: 0.19 - Getopt::Long: 2.38 - perl: 5.008008 - Pod::Usage: 1.26 - Term::ANSIColor: 1.10 - Test::Harness: 2.50 - Test::More: 0.98 - Text::ParseWords: 3.1 + Carp: '1.04' + Cwd: '3.00' + File::Basename: '1.00015' + File::Glob: '1.00015' + File::Next: '1.10' + File::Spec: '3.00' + File::Temp: '0.19' + Getopt::Long: '2.38' + Pod::Usage: '1.26' + Term::ANSIColor: '1.10' + Test::Harness: '2.50' + Test::More: '0.98' + Text::ParseWords: '3.1' + perl: '5.008008' resources: - bugtracker: http://github.com/petdance/ack2 - homepage: http://beyondgrep.com/ - license: http://www.perlfoundation.org/artistic_license_2_0 - MailingList: http://groups.google.com/group/ack-users - repository: git://github.com/petdance/ack2.git -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version 6.55_02 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + MailingList: http://groups.google.com/group/ack-users + bugtracker: http://github.com/petdance/ack2 + homepage: http://beyondgrep.com/ + license: http://www.perlfoundation.org/artistic_license_2_0 + repository: git://github.com/petdance/ack2.git +version: 2.15_02 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/ack new/ack-2.15_02/ack --- old/ack-2.15_01/ack 2015-02-13 23:27:10.000000000 +0100 +++ new/ack-2.15_02/ack 2015-12-17 22:59:10.000000000 +0100 @@ -3,7 +3,7 @@ use strict; use warnings; -our $VERSION = '2.15_01'; # Check http://beyondgrep.com/ for updates +our $VERSION = '2.15_02'; # Check http://beyondgrep.com/ for updates use 5.008008; use Getopt::Long 2.38 (); @@ -523,63 +523,24 @@ } } else { - # XXX unroll first match check ($has_printed_for_this_resource) - # XXX what if this is a *huge* file? (see also -l) - my $contents = do { - local $/; - <$fh>; - }; - - my $prev_match_end = 0; - my $line_no = 1; - - $match_column_number = undef; - while ( $contents =~ /$opt_regex/og ) { - my $match_start = $-[0]; - my $match_end = $+[0]; - - pos($contents) = $prev_match_end; - $prev_match_end = $match_end; - - while ( $contents =~ /\n/og && $-[0] < $match_start ) { - $line_no++; - } - - my $start_line = rindex($contents, "\n", $match_start); - my $end_line = index($contents, "\n", $match_end); - - if ( $start_line == -1 ) { - $start_line = 0; - } - else { - $start_line++; - } - - if ( $end_line == -1 ) { - $end_line = length($contents); - } - else { - $end_line--; - } - $match_column_number = $match_start - $start_line + 1; - if ( !$has_printed_for_this_resource ) { - if ( $opt_break && $has_printed_something ) { - App::Ack::print_blank_line(); - } - if ( $opt_show_filename && $opt_heading ) { - App::Ack::print_filename( $display_filename, $ors ); + while ( <$fh> ) { + $match_column_number = undef; + if ( /$opt_regex/o ) { + $match_column_number = $-[0] + 1; + if ( !$has_printed_for_this_resource ) { + if ( $opt_break && $has_printed_something ) { + App::Ack::print_blank_line(); + } + if ( $opt_show_filename && $opt_heading ) { + App::Ack::print_filename( $display_filename, $ors ); + } } + s/[\r\n]+$//g; + print_line_with_options($opt, $filename, $_, $., ':'); + $has_printed_for_this_resource = 1; + $nmatches++; + $max_count--; } - my $line = substr($contents, $start_line, $end_line - $start_line + 1); - $line =~ s/[\r\n]+$//g; - print_line_with_options($opt, $filename, $line, $line_no, ':'); - - pos($contents) = $end_line + 1; - - $has_printed_for_this_resource = 1; - $nmatches++; - $max_count--; - last unless $max_count != 0; } } @@ -640,6 +601,8 @@ my $offset = 0; # additional offset for when we add stuff my $previous_match_end = 0; + last if $-[0] == $+[0]; + for ( my $i = 1; $i < @+; $i++ ) { my ( $match_start, $match_end ) = ( $-[$i], $+[$i] ); @@ -669,6 +632,7 @@ $matched = 1; my ( $match_start, $match_end ) = ($-[0], $+[0]); next unless defined($match_start); + last if $match_start == $match_end; my $substring = substr( $line, $match_start, $match_end - $match_start ); @@ -839,23 +803,12 @@ } } else { - if ( $opt_v ) { - while ( <$fh> ) { - if (!/$opt_regex/o) { - $has_match = 1; - last; - } + while ( <$fh> ) { + if (/$opt_regex/o xor $opt_v) { + $has_match = 1; + last; } } - else { - # XXX read in chunks - # XXX only do this for certain file sizes? - my $content = do { - local $/; - <$fh>; - }; - $has_match = $content =~ /$opt_regex/o; - } close $fh; } @@ -873,17 +826,8 @@ } } else { - if ( $opt_v ) { - while ( <$fh> ) { - ++$nmatches if (!/$opt_regex/o); - } - } - else { - my $content = do { - local $/; - <$fh>; - }; - $nmatches =()= ($content =~ /$opt_regex/og); + while ( <$fh> ) { + ++$nmatches if (/$opt_regex/o xor $opt_v); } close $fh; } @@ -1932,13 +1876,19 @@ =head2 Why isn't ack finding a match in (some file)? -Probably because it's of a type that ack doesn't recognize. ack's -searching behavior is driven by filetype. B<If ack doesn't know -what kind of file it is, ack ignores the file.> - -Use the C<-f> switch to see a list of files that ack will search -for you. You can use the C<--show-types> switch to show which type -ack thinks each file is. +First, take a look and see if ack is even looking at the file. ack is +intelligent in what files it will search and which ones it won't, but +sometimes that can be surprising. + +Use the C<-f> switch, with no regex, to see a list of files that ack +will search for you. If your file doesn't show up in the list of files +that C<ack -f> shows, then ack never looks in it. + +NOTE: If you're using an old ack before 2.0, it's probably because it's of +a type that ack doesn't recognize. In ack 1.x, the searching behavior is +driven by filetype. B<If ack 1.x doesn't know what kind of file it is, +ack ignores the file.> You can use the C<--show-types> switch to show +which type ack thinks each file is. =head2 Wouldn't it be great if F<ack> did search & replace? @@ -2009,6 +1959,12 @@ The Perl language limits the repetition quanitifier to 32K. You can search for C<.{32767}> but not C<.{32768}>. +=head2 Ack does "X" and shouldn't, should it? + +We try to remain as close to grep's behavior as possible, so when in doubt, +see what grep does! If there's a mismatch in functionality there, please +bring it up on the ack-users mailing list. + =head1 ACKRC LOCATION SEMANTICS Ack can load its configuration from many sources. The following list @@ -2279,6 +2235,9 @@ How appropriate to have I<ack>nowledgements! Thanks to everyone who has contributed to ack in any way, including +SE<eacute>bastien FeugE<egrave>re, +Jakub Wilk, +Pete Houston, Stephen Thirlwall, Jonah Bishop, Chris Rebert, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-1.t new/ack-2.15_02/t/ack-1.t --- old/ack-2.15_01/t/ack-1.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-1.t 2015-12-17 22:59:10.000000000 +0100 @@ -17,7 +17,7 @@ ); my @files = qw( t/text ); - my @args = qw( Sue -1 -h ); + my @args = qw( Sue -1 -h --sort-files ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Looking for first instance of Sue!' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-c.t new/ack-2.15_02/t/ack-c.t --- old/ack-2.15_01/t/ack-c.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-c.t 2015-12-17 22:59:10.000000000 +0100 @@ -15,7 +15,7 @@ t/text/science-of-myth.txt ); - my @args = qw( religion -i -l ); + my @args = qw( religion -i -l --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for religion with -l' ); @@ -39,7 +39,7 @@ for my $switches ( @switches ) { my @files = qw( t/text ); - my @args = ( 'religion', @{$switches} ); + my @args = ( 'religion', @{$switches}, '--sort-files' ); ack_sets_match( [ @args, @files ], \@expected, "Looking for religion with @{$switches}" ); } @@ -65,7 +65,7 @@ for my $switches ( @switches ) { my @files = qw( t/text ); - my @args = ( 'religion', @{$switches} ); + my @args = ( 'religion', @{$switches}, '--sort-files' ); ack_sets_match( [ @args, @files ], \@expected, '-l -v will mostly likely match all input files' ); } @@ -83,7 +83,7 @@ t/text/shut-up-be-happy.txt:0 ); - my @args = qw( boy -i -c ); + my @args = qw( boy -i -c --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'Boy counts' ); @@ -94,7 +94,7 @@ t/text/science-of-myth.txt:2 ); - my @args = qw( religion -i -l -c ); + my @args = qw( religion -i -l -c --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'Religion counts -l -c' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-f.t new/ack-2.15_02/t/ack-f.t --- old/ack-2.15_01/t/ack-f.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-f.t 2015-12-17 22:59:10.000000000 +0100 @@ -63,6 +63,7 @@ t/swamp/service.svc t/swamp/stuff.cmake t/swamp/CMakeLists.txt + t/swamp/swamp/ignoreme.txt ), 't/swamp/not-an-#emacs-workfile#', ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-g.t new/ack-2.15_02/t/ack-g.t --- old/ack-2.15_01/t/ack-g.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-g.t 2015-12-17 22:59:10.000000000 +0100 @@ -157,7 +157,7 @@ $regex = 'of'; @files = qw( t/text ); - @args = ( '-Q', '-g', $regex ); + @args = ( '-Q', '-g', $regex, '--sort-files' ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex with quotemeta." ); }; @@ -166,7 +166,7 @@ my @expected = qw(); my $regex = 'free'; - my @args = ( '-w', '-g', $regex ); # The -w means "free" won't match "freedom" + my @args = ( '-w', '-g', $regex, '--sort-files' ); # The -w means "free" won't match "freedom" my @files = qw( t/text/ ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex with '-w'." ); @@ -179,7 +179,7 @@ $regex = 'of'; @files = qw( t/text ); - @args = ( '-w', '-g', $regex ); + @args = ( '-w', '-g', $regex, '--sort-files' ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex with '-w'." ); }; @@ -194,7 +194,7 @@ ); my $file_regex = 'of'; - my @args = ( '-v', '-g', $file_regex ); + my @args = ( '-v', '-g', $file_regex, '--sort-files' ); my @files = qw( t/text/ ); ack_sets_match( [ @args, @files ], \@expected, "Looking for file names that do not match $file_regex" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-ignore-dir.t new/ack-2.15_02/t/ack-ignore-dir.t --- old/ack-2.15_01/t/ack-ignore-dir.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-ignore-dir.t 2015-12-17 22:59:10.000000000 +0100 @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 39; +use Test::More tests => 45; use File::Spec; use lib 't'; @@ -205,6 +205,20 @@ sets_match( \@results, \@expected, $test_description ); } +IGNORE_DIR_DONT_IGNORE_TARGET: { + my @stdout = run_ack('--ignore-dir=swamp', '-f', 't/swamp'); + + isnt(scalar(@stdout), 0, 'Specifying a directory on the command line should override ignoring it'); +} + +IGNORE_SUBDIR_OF_TARGET: { + my @stdout = run_ack('--ignore-dir=swamp', '-l', 'quux', 't/swamp'); + is(scalar(@stdout), 0, 'Specifying a directory on the command line should still ignore matching subdirs'); + + @stdout = run_ack('-l', 'quux', 't/swamp'); + is(scalar(@stdout), 1, 'Double-check it is found without ignore-dir'); +} + # --noignore-dir=firstlinematch # --ignore-dir=... + --noignore-dir=ext # --ignore-dir=is + --noignore-dir=match diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-ignore-file.t new/ack-2.15_02/t/ack-ignore-file.t --- old/ack-2.15_01/t/ack-ignore-file.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-ignore-file.t 2015-12-17 22:59:10.000000000 +0100 @@ -1,8 +1,8 @@ -#!/usr/bin/env perl +#!perl use strict; use warnings; -use Test::More skip_all => 'NYI'; +use Test::More skip_all => 'Not yet implemented'; # XXX look at --ignore-dir, but apply to --ignore-file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-interactive.t new/ack-2.15_02/t/ack-interactive.t --- old/ack-2.15_01/t/ack-interactive.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-interactive.t 2015-12-17 22:59:10.000000000 +0100 @@ -19,7 +19,7 @@ prep_environment(); INTERACTIVE_GROUPING_NOCOLOR: { - my @args = qw( Sue --nocolor ); + my @args = qw( Sue --nocolor --sort-files ); my @files = qw( t/text ); my $output = run_ack_interactive(@args, @files); @@ -37,7 +37,7 @@ } INTERACTIVE_NOHEADING_NOCOLOR: { - my @args = qw( Sue --nocolor --noheading); + my @args = qw( Sue --nocolor --noheading --sort-files ); my @files = qw( t/text ); my $output = run_ack_interactive(@args, @files); @@ -54,7 +54,7 @@ } INTERACTIVE_NOGROUP_NOCOLOR: { - my @args = qw( Sue --nocolor --nogroup); + my @args = qw( Sue --nocolor --nogroup --sort-files ); my @files = qw( t/text ); my $output = run_ack_interactive(@args, @files); @@ -71,7 +71,7 @@ } INTERACTIVE_GROUPING_COLOR: { - my @args = qw( Sue ); # --color is on by default + my @args = qw( Sue --sort-files ); # --color is on by default my @files = qw( t/text ); my $CFN = color 'bold green'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-m.t new/ack-2.15_02/t/ack-m.t --- old/ack-2.15_01/t/ack-m.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-m.t 2015-12-17 22:59:10.000000000 +0100 @@ -11,7 +11,7 @@ prep_environment(); -my @text = map { +my @text = sort map { untaint($_) } glob( 't/text/s*.txt' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-match.t new/ack-2.15_02/t/ack-match.t --- old/ack-2.15_01/t/ack-match.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-match.t 2015-12-17 22:59:10.000000000 +0100 @@ -91,6 +91,7 @@ my $regex = shift; my @args = @_; + push @args, '--sort-files'; return subtest "test_match( @args )" => sub { my @files = ( 't/text' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-o.t new/ack-2.15_02/t/ack-o.t --- old/ack-2.15_01/t/ack-o.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-o.t 2015-12-17 22:59:10.000000000 +0100 @@ -64,7 +64,7 @@ # Give an output function and find match in multiple files (so print filenames, just like grep -o). WITH_OUTPUT: { my @files = qw( t/text/ ); - my @args = qw/ --output=x$1x question(\\S+) /; + my @args = qw/ --output=x$1x question(\\S+) --sort-files /; my @target_file = ( File::Next::reslash( 't/text/science-of-myth.txt' ), @@ -81,7 +81,7 @@ OUTPUT_DOUBLE_QUOTES: { my @files = qw( t/text/ ); - my @args = ( '--output="$1"', 'question(\\S+)' ); + my @args = ( '--output="$1"', 'question(\\S+)', '--sort-files' ); my @target_file = ( File::Next::reslash( 't/text/science-of-myth.txt' ), @@ -117,7 +117,7 @@ HOME_ACKRC_OUTPUT_PERMITTED: { my @files = untaint( File::Spec->rel2abs('t/text/') ); - my @args = qw/ --env question(\\S+) /; + my @args = qw/ --env question(\\S+) --sort-files /; write_file(File::Spec->catfile($tempdir->dirname, '.ackrc'), "--output=foo\n"); chdir File::Spec->catdir($tempdir->dirname, 'subdir'); @@ -133,7 +133,7 @@ ACKRC_ACKRC_OUTPUT_PERMITTED: { my @files = untaint( File::Spec->rel2abs('t/text/') ); - my @args = qw/ --env question(\\S+) /; + my @args = qw/ --env question(\\S+) --sort-files /; write_file(File::Spec->catfile($tempdir->dirname, '.ackrc'), "--output=foo\n"); chdir File::Spec->catdir($tempdir->dirname, 'subdir'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-pager.t new/ack-2.15_02/t/ack-pager.t --- old/ack-2.15_01/t/ack-pager.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-pager.t 2015-12-17 22:59:10.000000000 +0100 @@ -20,7 +20,7 @@ prep_environment(); NO_PAGER: { - my @args = qw(--nocolor Sue t/text); + my @args = qw(--nocolor --sort-files Sue t/text); my @expected = split /\n/, <<'END_TEXT'; t/text/boy-named-sue.txt @@ -39,7 +39,7 @@ } PAGER: { - my @args = qw(--nocolor --pager=./test-pager Sue t/text); + my @args = qw(--nocolor --pager=./test-pager --sort-files Sue t/text); my @expected = split /\n/, <<'END_TEXT'; t/text/boy-named-sue.txt @@ -58,7 +58,7 @@ } PAGER_WITH_OPTS: { - my @args = ('--nocolor', '--pager=./test-pager --skip=2', 'Sue', 't/text'); + my @args = ('--nocolor', '--pager=./test-pager --skip=2', '--sort-files', 'Sue', 't/text'); my @expected = split /\n/, <<'END_TEXT'; t/text/boy-named-sue.txt @@ -73,7 +73,7 @@ } FORCE_NO_PAGER: { - my @args = ('--nocolor', '--pager=./test-pager --skip=2', '--nopager', + my @args = ('--nocolor', '--pager=./test-pager --skip=2', '--nopager', '--sort-files', 'Sue', 't/text'); my @expected = split /\n/, <<'END_TEXT'; @@ -96,7 +96,7 @@ local $ENV{'ACK_PAGER'} = './test-pager --skip=2'; local $TODO = q{Setting ACK_PAGER in tests won't work for the time being}; - my @args = ('--nocolor', 'Sue', 't/text'); + my @args = ('--nocolor', '--sort-files', 'Sue', 't/text'); my @expected = split /\n/, <<'END_TEXT'; t/text/boy-named-sue.txt @@ -113,7 +113,7 @@ PAGER_ENV_OVERRIDE: { local $ENV{'ACK_PAGER'} = './test-pager --skip=2'; - my @args = ('--nocolor', '--nopager', 'Sue', 't/text'); + my @args = ('--nocolor', '--nopager', '--sort-files', 'Sue', 't/text'); my @expected = split /\n/, <<'END_TEXT'; t/text/boy-named-sue.txt @@ -132,7 +132,7 @@ } PAGER_ACKRC: { - my @args = ('--nocolor', 'Sue', 't/text'); + my @args = ('--nocolor', '--sort-files', 'Sue', 't/text'); my $ackrc = <<'END_ACKRC'; --pager=./test-pager --skip=2 @@ -153,7 +153,7 @@ } PAGER_ACKRC_OVERRIDE: { - my @args = ('--nocolor', '--nopager', 'Sue', 't/text'); + my @args = ('--nocolor', '--nopager', '--sort-files', 'Sue', 't/text'); my $ackrc = <<'END_ACKRC'; --pager=./test-pager --skip=2 @@ -180,7 +180,7 @@ PAGER_NOENV: { local $ENV{'ACK_PAGER'} = './test-pager --skip=2'; - my @args = ('--nocolor', '--noenv', 'Sue', 't/text'); + my @args = ('--nocolor', '--noenv', '--sort-files', 'Sue', 't/text'); my @expected = split /\n/, <<'END_TEXT'; t/text/boy-named-sue.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-v.t new/ack-2.15_02/t/ack-v.t --- old/ack-2.15_01/t/ack-v.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-v.t 2015-12-17 22:59:10.000000000 +0100 @@ -32,7 +32,7 @@ t/text/shut-up-be-happy.txt ); - my @args = qw( religion -i -v -l ); + my @args = qw( religion -i -v -l --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'No religion please' ); @@ -52,7 +52,7 @@ t/text/shut-up-be-happy.txt:26 ); - my @args = qw( religion -i -v -c ); + my @args = qw( religion -i -v -c --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'Non-religion counts' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-w.t new/ack-2.15_02/t/ack-w.t --- old/ack-2.15_01/t/ack-w.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-w.t 2015-12-17 22:59:10.000000000 +0100 @@ -17,7 +17,7 @@ ); my @files = qw( t/text ); - my @args = qw( Sue! -w -h ); + my @args = qw( Sue! -w -h --sort-files ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for Sue!' ); } @@ -29,7 +29,7 @@ ); my @files = qw( t/text ); - my @args = qw( mu\w -w -h ); + my @args = qw( mu\w -w -h --sort-files ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for mu\\w' ); } @@ -43,7 +43,7 @@ ); my @files = qw( t/text ); - my @args = ( 'mu.', qw( -w -h ) ); + my @args = ( 'mu.', qw( -w -h --sort-files ) ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for mu.' ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/ack-x.t new/ack-2.15_02/t/ack-x.t --- old/ack-2.15_01/t/ack-x.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/ack-x.t 2015-12-17 22:59:10.000000000 +0100 @@ -95,7 +95,7 @@ EOF my $perl = caret_X(); -my @lhs_args = ( $perl, '-Mblib', build_ack_invocation( '-g', 'of', 't/text' ) ); +my @lhs_args = ( $perl, '-Mblib', build_ack_invocation( '--sort-files', '-g', 'of', 't/text' ) ); my @rhs_args = ( $perl, '-Mblib', build_ack_invocation( '-x', 'the' ) ); # for now if ( $ENV{'ACK_TEST_STANDALONE'} ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/anchored.t new/ack-2.15_02/t/anchored.t --- old/ack-2.15_01/t/anchored.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/anchored.t 2015-12-17 22:59:10.000000000 +0100 @@ -14,7 +14,7 @@ my @files = qw( t/text ); FRONT_ANCHORED: { - my @args = qw( -h -i ^science ); + my @args = qw( --sort-files -h -i ^science ); my @expected = split( /\n/, <<'EOF' ); Science and religion are not mutually exclusive @@ -24,7 +24,7 @@ } BACK_ANCHORED: { - my @args = qw( -h -i done$ ); + my @args = qw( --sort-files -h -i done$ ); my @expected = split( /\n/, <<'EOF' ); Through all kinds of weather and everything we done @@ -35,7 +35,7 @@ } UNANCHORED: { - my @args = qw( -h -i science ); + my @args = qw( --sort-files -h -i science ); my @expected = split( /\n/, <<'EOF' ); Science and religion are not mutually exclusive diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/context.t new/ack-2.15_02/t/context.t --- old/ack-2.15_01/t/context.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/context.t 2015-12-17 22:59:10.000000000 +0100 @@ -44,7 +44,7 @@ my $regex = 'laugh'; my @files = qw( t/text ); - my @args = ( '-B2', $regex ); + my @args = ( '--sort-files', '-B2', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex - before with line numbers" ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/default-filter.t new/ack-2.15_02/t/default-filter.t --- old/ack-2.15_01/t/default-filter.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/default-filter.t 2015-12-17 22:59:10.000000000 +0100 @@ -92,5 +92,6 @@ 't/swamp/groceries/subdir/meat', 't/swamp/stuff.cmake', 't/swamp/CMakeLists.txt', + 't/swamp/swamp/ignoreme.txt', ], 'only non-binary files should be matched' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/highlighting.t new/ack-2.15_02/t/highlighting.t --- old/ack-2.15_01/t/highlighting.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/highlighting.t 2015-12-17 22:59:10.000000000 +0100 @@ -15,7 +15,7 @@ my @HIGHLIGHT = qw( --color --group --sort-files ); BASIC: { - my @args = qw( beliefs t/text/ ); + my @args = qw( --sort-files beliefs t/text/ ); my $expected_original = <<'END'; <t/text/science-of-myth.txt> @@ -34,7 +34,7 @@ METACHARACTERS: { - my @args = qw( \w*din\w* t/text/ ); + my @args = qw( --sort-files \w*din\w* t/text/ ); my $expected_original = <<'END'; <t/text/4th-of-july.txt> {24}:(Riding) shotgun from town to town @@ -58,7 +58,7 @@ CONTEXT: { - my @args = qw( love -C1 t/text/ ); + my @args = qw( --sort-files love -C1 t/text/ ); my $expected_original = <<'END'; <t/text/4th-of-july.txt> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/inverted-file-filter.t new/ack-2.15_02/t/inverted-file-filter.t --- old/ack-2.15_01/t/inverted-file-filter.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/inverted-file-filter.t 2015-12-17 22:59:10.000000000 +0100 @@ -51,6 +51,7 @@ t/swamp/service.svc t/swamp/stuff.cmake t/swamp/CMakeLists.txt + t/swamp/swamp/ignoreme.txt ), 't/swamp/not-an-#emacs-workfile#', ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/issue562.t new/ack-2.15_02/t/issue562.t --- old/ack-2.15_01/t/issue562.t 1970-01-01 01:00:00.000000000 +0100 +++ new/ack-2.15_02/t/issue562.t 2015-12-17 22:59:10.000000000 +0100 @@ -0,0 +1,23 @@ +#!perl -T + +use strict; +use warnings; +use lib 't'; + +use Test::More tests => 2; +use File::Temp; +use Util; + +prep_environment(); + +my $tempfile = File::Temp->new(); +print {$tempfile} <<'END_OF_FILE'; + + + +END_OF_FILE +close $tempfile; + +my @results = run_ack('^\s\s+$', $tempfile->filename); + +lists_match(\@results, [], '^\s\s+$ should never match a sequence of empty lines'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/issue571.t new/ack-2.15_02/t/issue571.t --- old/ack-2.15_01/t/issue571.t 1970-01-01 01:00:00.000000000 +0100 +++ new/ack-2.15_02/t/issue571.t 2015-12-17 22:59:10.000000000 +0100 @@ -0,0 +1,23 @@ +#!perl -T + +use strict; +use warnings; +use lib 't'; + +use Test::More tests => 2; +use File::Temp; +use Util; + +prep_environment(); + +my $tempfile = File::Temp->new(); +print {$tempfile} <<'END_OF_FILE'; +fo + +oo +END_OF_FILE +close $tempfile; + +my @results = run_ack('-l', 'fo\s+oo', $tempfile->filename); + +lists_match(\@results, [], '\s+ should never match across line boundaries'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/resource-iterator.t new/ack-2.15_02/t/resource-iterator.t --- old/ack-2.15_01/t/resource-iterator.t 2015-02-13 23:17:29.000000000 +0100 +++ new/ack-2.15_02/t/resource-iterator.t 2015-12-17 22:59:10.000000000 +0100 @@ -113,6 +113,7 @@ t/swamp/solution8.tar t/swamp/stuff.cmake t/swamp/CMakeLists.txt + t/swamp/swamp/ignoreme.txt ), 't/swamp/#emacs-workfile.pl#', 't/swamp/not-an-#emacs-workfile#', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ack-2.15_01/t/swamp/swamp/ignoreme.txt new/ack-2.15_02/t/swamp/swamp/ignoreme.txt --- old/ack-2.15_01/t/swamp/swamp/ignoreme.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/ack-2.15_02/t/swamp/swamp/ignoreme.txt 2015-12-17 22:59:10.000000000 +0100 @@ -0,0 +1 @@ +quux