Ignoring directories with a pattern in ackrc

708 views
Skip to first unread message

Thameera Senanayaka

unread,
May 3, 2013, 2:44:06 AM5/3/13
to ack-...@googlegroups.com
Hi,

I have directories that are named like bc0081, bc0091, bc0171 and so on. Is it possible to give a pattern to --ignore-dir? I tried --ignore-dir=bc0* but it doesn't seem to work.

Thanks,
Thameera

Andy Lester

unread,
May 3, 2013, 8:43:01 AM5/3/13
to ack-...@googlegroups.com

On May 3, 2013, at 1:44 AM, Thameera Senanayaka <thame...@gmail.com> wrote:

> I have directories that are named like bc0081, bc0091, bc0171 and so on. Is it possible to give a pattern to --ignore-dir? I tried --ignore-dir=bc0* but it doesn't seem to work.

Wait until ack 2.06. Right now, we don't support any sort of matching other than exact filenames.

After 2.06 comes out, you'll do that as: --ignore-dir=match:bc0.* or even --ignore-dir=match:^bc0\d+$

Note that --ignore-dir and --ignore-file and indeed all file-match in ack is done with regular expressions, *not* with shell glob patterns.

xoa

--
Andy Lester => an...@petdance.com => www.petdance.com => AIM:petdance

Perry Trinier

unread,
Nov 18, 2016, 4:42:36 PM11/18/16
to ack users
Hi there,

Sorry to revive an ancient thread, but I'm using ack version 2.14 and when I try regex file matching as above I get the following:

Non-is filters are not yet supported for --ignore-dir at /usr/local/bin/ack line 155.
main::_compile_file_filter(HASH(0x7fb9121a7d20), ARRAY(0x7fb9140bccc8)) called at /usr/local/bin/ack line 946
main::main() called at /usr/local/bin/ack line 73

Was the regex file matching never fully implemented?

Andy Lester

unread,
Nov 18, 2016, 4:43:38 PM11/18/16
to ack-...@googlegroups.com

> On Nov 18, 2016, at 2:26 PM, Perry Trinier <perryt...@gmail.com> wrote:
>
> Sorry to revive an ancient thread, but I'm using ack version 2.14 and when I try regex file matching as above I get the following:
>
> Non-is filters are not yet supported for --ignore-dir at /usr/local/bin/ack line 155.
> main::_compile_file_filter(HASH(0x7fb9121a7d20), ARRAY(0x7fb9140bccc8)) called at /usr/local/bin/ack line 946
> main::main() called at /usr/local/bin/ack line 73

Can you please paste the exact command line you used?

--
Andy Lester => www.petdance.com

Perry Trinier

unread,
Nov 19, 2016, 1:56:19 PM11/19/16
to ack-...@googlegroups.com
Here's the line from my ackrc: --ignore-dir=match:.*target . Since I couldn't get this to work I just listed each target directory separately in the ackrc.


--
You received this message because you are subscribed to a topic in the Google Groups "ack users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ack-users/755NSHRWPdQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ack-users+unsubscribe@googlegroups.com.
To post to this group, send email to ack-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ack-users.
For more options, visit https://groups.google.com/d/optout.

Andy Lester

unread,
Nov 19, 2016, 9:21:47 PM11/19/16
to ack-...@googlegroups.com

> On Nov 19, 2016, at 12:55 PM, Perry Trinier <perryt...@gmail.com> wrote:
>
> Here's the line from my ackrc: --ignore-dir=match:.*target . Since I couldn't get this to work I just listed each target directory separately in the ackrc.
>

Can you please post a full command line, with the --noenv flag (so it ignores .ackrc), and the exact error message it gave?

Perry Trinier

unread,
Nov 20, 2016, 1:59:11 PM11/20/16
to ack-...@googlegroups.com
ptrinier@mbp dev: ack search --noenv --ignore-dir=match:.*target
Non-is filters are not yet supported for --ignore-dir at /usr/local/bin/ack line 155.
main::_compile_file_filter(HASH(0x7fc4a28f9938), ARRAY(0x7fc4a30ac2e0)) called at /usr/local/bin/ack line 946
main::main() called at /usr/local/bin/ack line 73

Andy Lester

unread,
Nov 20, 2016, 6:38:00 PM11/20/16
to ack-...@googlegroups.com

> On Nov 18, 2016, at 2:26 PM, Perry Trinier <perryt...@gmail.com> wrote:
>
> Sorry to revive an ancient thread, but I'm using ack version 2.14 and when I try regex file matching as above I get the following:
>
> Non-is filters are not yet supported for --ignore-dir at /usr/local/bin/ack line 155.
> main::_compile_file_filter(HASH(0x7fb9121a7d20), ARRAY(0x7fb9140bccc8)) called at /usr/local/bin/ack line 946
> main::main() called at /usr/local/bin/ack line 73

Yes, in 2.15_01 we added:

* ack now supports --ignore-dir=match:.... Thanks, Ailin Nemui! (GitHub ticket #42)

What threw me off was the stack trace. Did you do something to add a Carp::Always call to your ack?
Reply all
Reply to author
Forward
0 new messages