I use astyle
to get my Java and C++ into a unified look. Sometimes I write something and check it into git before running astyle
. So I will end up with a commit message like Run astyle
which makes cherry-picking and all the like more difficult.
I tried to write a pre-commit hook, but that cannot alter what is going to be commited, it will just fix it in the next commit. I tried a filter, but that does not change the files on the disk.
Is there some neat way to get git to run something before even assessing the changed, other than writing a small script (and remember to use it)?