Skip to content

Files without an extension #213

Closed
wants to merge 1 commit into from

5 participants

@willert
willert commented Mar 7, 2012

Allow files without an extension to be recognized as a distinct type. Keep old behavior unless --type-allow-empty is explicitly specified to ensure backwards-compatibility. Added tests and help text for this change.

@willert willert Allow files without an extension to be recognized as a distinct type.…
… Keep old behavior unless --type-allow-empty is explicitly specified. Added tests and help text for this change.
4ffcc40
@petdance
Owner
petdance commented Mar 7, 2012

Thanks for the patch. At this point, I don't want ack 1.x to have any radically new functionality. ack 2.0 (the ack2 project here on github) will address this.

@petdance petdance closed this Mar 7, 2012
@petdance petdance reopened this Mar 7, 2012
@petdance
Owner
petdance commented Mar 7, 2012

Hmmm, maybe it wouldn't be horrible to add this. Have you had anyone else use it?

@willert
willert commented Mar 7, 2012

No I haven't had anyone using it and no one would come to mind. But I tried to keep the changes to be minimally invasive and not alter any of the existing behavior. The fact that I didn't have to adapt any test cases (apart from the additional text file in t/swamp) reflects this quite nicely :)

To give some motivation for this change: I am an heavy user of ack-and-a-half.el and eproject.el in emacs. A very useful feature is 'ack-same, i.E. search in all files of the same type. I do a lot of editing of HTML::Mason templates which carry no extension. Without this patch ack doesn't recognize files without extension as having the same extension as the current one, i.e. none. I'd have to have three distinct ack commands (ack-in-eproject, ack-same-in-this-directory, ack-all-in-this-directory) instead of two, and you know how overloaded the keymap and muscle memory in emacs already is ;)

@petdance
Owner
petdance commented Mar 7, 2012

I forwarded your pull request for public commentary to ack-users. If you're not on that list, I welcome you to join it.

https://groups.google.com/forum/?fromgroups#!topic/ack-users/4tbdPtbeguY

@willert
willert commented Mar 7, 2012

Thanks. I have joined and will keep an eye on the discussion.

Cheers

@suan
suan commented Mar 7, 2012

I am actively using this and have a personal fork just for this functionality: https://github.com/suan/ack/compare/master

In my case I want to ignore "lock" files, which don't have read permissions and throw annoying "permission denied" warnings. Another use-case I have (but have been too lazy to add) is to recognize Vagrantfile as a Ruby file.

Would love to see this get merged in :)

@xianxu
xianxu commented Mar 15, 2013

I use this. In Twitter's pants build system, build files are all named BUILD in arbitrary directories.

@hoelzro
Collaborator
hoelzro commented Aug 28, 2013

Moved to the ack2 queue.

@hoelzro hoelzro closed this Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.