AStyle Git precommit hook for code beautification enforcement
- deletes trailing whitespaces by default
- Creates a backup in a folder with date/time
- Two styles defined: Linux kernel, and User space.
- Astyle (Artistic style) installed and added to PATH.
- copy the file to .git/hooks in desired repository.
- Add execution mode (chmod +x)
- Optional: Installation for every created repository.
sudo cp ./pre-commit /usr/share/git-core/templates/hooks/
- To bypass the hook, just add -n to the git commit command ( git commit -n)