Ignore indentation in git diffs
This commit is contained in:
parent
65a868210d
commit
eff43092cc
1 changed files with 8 additions and 5 deletions
13
bin/get
13
bin/get
|
|
@ -127,25 +127,28 @@ git status \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
diff)
|
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
|
if [ -z "$2" ]; then
|
||||||
echo 'Compare working tree with HEAD'
|
echo 'Compare working tree with HEAD'
|
||||||
git diff HEAD
|
git diff HEAD --ignore-space-change
|
||||||
else
|
else
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$3" ]; then
|
||||||
if [ "$2" = 'STAGE' ]; then
|
if [ "$2" = 'STAGE' ]; then
|
||||||
echo 'Compare working tree with stage'
|
echo 'Compare working tree with stage'
|
||||||
git diff
|
git diff --ignore-space-change
|
||||||
else
|
else
|
||||||
echo "Compare working tree with $2"
|
echo "Compare working tree with $2"
|
||||||
git diff "$2"
|
git diff "$2" --ignore-space-change
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "$2" = 'STAGE' ]; then
|
if [ "$2" = 'STAGE' ]; then
|
||||||
echo "Compare stage with $3"
|
echo "Compare stage with $3"
|
||||||
git diff --cached "$3"
|
git diff --cached "$3" --ignore-space-change
|
||||||
else
|
else
|
||||||
echo "Compare $2 with $3"
|
echo "Compare $2 with $3"
|
||||||
git diff "$2" "$3"
|
git diff "$2" "$3" --ignore-space-change
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue