improve speed on pre-commit

Only generate docs when a change has been detected in that dir, and
only reindent on changed files. Vastly improves commit time, from 2+
seconds to almost instant, depending on the files changed.