Following a similar idea as this pre-commit hook, you could use:
git diff --cached --name-only
That would list the files that are about to be committed, and you can then filter on them in order to apply your controls or to skip those files.
In other words, the hook is still running on every commit, for every files.
But its script is smart enough to apply its test to the right files within the list of files to be committed.