Using Darcs, etckeeper pre-commit was annoyingly slow. Profiling
pre-commit.d, I found about 3s were spent running readlink(1) on each
link in /etc/, though there were only 590 links.
Fortunately, GNU find supports -printf, so readlink(1) isn't required.
Similarly, the stat(1) per chown/chmod/chgrp entry isn't required.
Finally, I wanted .etckeeper to ignore backup~ files. I added -name
\*~ -o to $NOVCS, which required turning it into a wrapper function.
Ugly, but at least it's applied consistently to all find(1) calls
(cf. filter_ignore). I threw in an -O2 for the hell of it.
Before:
# time sh -c 'etckeeper pre-commit; etckeeper pre-commit; etckeeper pre-commit'
real 0m10.402s
user 0m1.200s
sys 0m2.536s
After:
# time sh -c 'etckeeper pre-commit; etckeeper pre-commit; etckeeper pre-commit'
real 0m2.770s
user 0m1.284s
sys 0m1.500s
Feel free to WONTFIX this if you have a "no GNUisms" policy.