ack 2: .ackrc vs. _ackrc

51 views
Skip to first unread message

Christopher J. Madsen

unread,
Jun 16, 2012, 11:52:59 PM6/16/12
to ack-...@googlegroups.com
In ack 2.0, you can use either .ackrc or _ackrc for project-specific
config. (I've submitted a pull req to allow the same choice for the
user-specific config, but it hasn't been merged yet:
https://github.com/petdance/ack2/pull/109 .)

But what should ack do if a directory contains both .ackrc and _ackrc?
The current behavior is to load .ackrc and ignore _ackrc. But this
could be confusing, especially since .ackrc is a hidden file in Unix,
and _ackrc isn't.

Some possible behaviors for a directory with both .ackrc and _ackrc :

* Load both

But why would we need two files?

* Load _ackrc and ignore .ackrc

But this makes it seem like _ackrc is the preferred name,
which isn't really the case.

* Throw an error (or a warning)

I'm leaning towards this (probably a warning rather than an error)

What do other people think?

--
Chris Madsen pe...@cjmweb.net
-------------------- http://www.cjmweb.net --------------------

Andy Lester

unread,
Jun 17, 2012, 11:00:03 AM6/17/12
to ack-...@googlegroups.com

On Jun 16, 2012, at 10:52 PM, Christopher J. Madsen wrote:

But what should ack do if a directory contains both .ackrc and _ackrc?

My initial reaction is that we should fail, because it is likely a problem that the user is not aware of.

xoxo,
Andy


Christopher J. Madsen

unread,
Jun 17, 2012, 10:24:46 PM6/17/12
to ack-...@googlegroups.com
On 6/17/2012 10:00 AM, Andy Lester wrote:
> On Jun 16, 2012, at 10:52 PM, Christopher J. Madsen wrote:
>
>> But what should ack do if a directory contains both .ackrc and _ackrc?
>
> My initial reaction is that we should fail, because it is likely a problem that the user is not aware of.

My initial reaction to that was that it makes possible a sort of DoS
attack, especially if the filesystem is read-only (like a CD). But you
can already do that just by putting invalid content into .ackrc, so
making this an error doesn't really change anything.

I've added a commit to my pull req
(https://github.com/petdance/ack2/pull/109) that makes this an error
(and changed the test to match).
Reply all
Reply to author
Forward
0 new messages