From eff43092cc1e2b5477c1e8c86b798422a21c919a Mon Sep 17 00:00:00 2001 From: William Hilton Date: Sun, 6 Sep 2015 00:54:02 -0400 Subject: [PATCH] Ignore indentation in git diffs --- bin/get | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/get b/bin/get index b4f5070..d86a8f6 100755 --- a/bin/get +++ b/bin/get @@ -127,25 +127,28 @@ git status \ ;; diff) +# Note: we use --ignore-space-change with every diff because +# changing the amount of indentation of large chunks of code +# is common in Python and CoffeeScript. if [ -z "$2" ]; then echo 'Compare working tree with HEAD' - git diff HEAD + git diff HEAD --ignore-space-change else if [ -z "$3" ]; then if [ "$2" = 'STAGE' ]; then echo 'Compare working tree with stage' - git diff + git diff --ignore-space-change else echo "Compare working tree with $2" - git diff "$2" + git diff "$2" --ignore-space-change fi else if [ "$2" = 'STAGE' ]; then echo "Compare stage with $3" - git diff --cached "$3" + git diff --cached "$3" --ignore-space-change else echo "Compare $2 with $3" - git diff "$2" "$3" + git diff "$2" "$3" --ignore-space-change fi fi fi