Skip to content

Instantly share code, notes, and snippets.

@r1walz
Created March 19, 2019 16:13
Show Gist options
  • Save r1walz/019c8dfb5e1bab010b9fc532474850f4 to your computer and use it in GitHub Desktop.
Save r1walz/019c8dfb5e1bab010b9fc532474850f4 to your computer and use it in GitHub Desktop.
Setup file to test `git diff --ignore-whitespace -p`
#!/bin/bash
if ! test -d /tmp/tmp
then
mkdir -p /tmp/tmp
else
rm -rf /tmp/tmp
mkdir /tmp/tmp
fi
pushd /tmp/tmp
git init
echo "first commit" >first_commit
git add first_commit
git commit -m "initial commit"
echo "file with trailing spaces " >file_with_trailing_spaces
git add file_with_trailing_spaces
git commit -m "c1"
echo "file with trailing tab " >file_with_trailing_tab
git add file_with_trailing_tab
git commit -m "c2"
cat << EOF >code_with_whitespaces
for i in range(10):
f(x) != F(x)
do while not exhausted
done
bye!
EOF
git add code_with_whitespaces
git commit -m "c3"
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment