Created
September 13, 2013 20:03
-
-
Save cddr/6555387 to your computer and use it in GitHub Desktop.
Fixes whitespace only on the lines I've changed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Really dumb script to fix up whitespace but only on the lines changed in the current | |
# commit. Run this script from your $PROJECT/.git/hooks/pre-commit | |
# | |
git diff HEAD --no-color > /tmp/stage.diff | |
git apply -R /tmp/stage.diff | |
git apply --whitespace=fix /tmp/stage.diff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment