Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
109 views
in Technique[技术] by (71.8m points)

How can I get ack to ignore *.orig files?

I put this in my .ackrc:

--type-set=DUMB=*.orig
--noDUMB

... but I'm still seeing files like main.py.orig in my ack results. I tried doing --type-set=DUMB=*.*.orig too, but that didn't work either.

More info

Run from my command line (OSX Snow Leopard with :

timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± ack modules --python | grep '.orig'
src/rafa/main.py.orig:25:import rafa.ui.modules.helpers
src/rafa/main.py.orig:26:from rafa.ui.modules.performable_form import PerformableForm
src/rafa/main.py.orig:27:from rafa.ui.modules.page_form import PageEditForm
src/rafa/main.py.orig:28:from rafa.ui.modules.settings_form import SettingsForm
....

timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± cat ~/.ackrc 
--color
--sort-files
--smart-case

--type-set=sass=.sass
--type-set=coffee=.coffee

--ignore-dir=rafa/static
--ignore-dir=compiled
--ignore-dir=compressed

--ignore-dir=venv
--ignore-dir=build

timmfin at lorien in ~/dev/performable/rafa on landing-pages-csv-and-more!
± ack --version
ack 1.94
Running under Perl 5.10.0 at /usr/bin/perl
question from:https://stackoverflow.com/questions/4748529/how-can-i-get-ack-to-ignore-orig-files

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For ack version 1.x

I found this worked if I removed the asterisk (from the Ackmate wiki)

--type-set=DUMB=.orig
--noDUMB

You can see what types of file ackmate supports by running (including those you've specified in ~/.ackrc):

~/Library/Application Support/TextMate/PlugIns/AckMate.tmplugin/Contents/Resources/ackmate_ack --help type

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...