ambevar-dotfiles/.scripts/git-compare

20 lines
412 B
Plaintext
Raw Normal View History

#!/bin/sh
if [ $# -ne 1 ]; then
2013-10-23 11:24:12 +02:00
cat<<EOF
Usage: ${0##*/} FOLDER
Compare current git repo with FOLDER.
EOF
exit
fi
REPO="$(mktemp)"
FOLDER="$(mktemp)"
git ls-files | sort > "$REPO"
find "$1" -type f ! -path "*.git/*" | sed 's/^[^\/]*\///g' | sort > "$FOLDER"
rm -f "$REPO" "$FOLDER"
## Zsh version.
# comm -3 <(git ls-files | sort) <(find "$1" -type f ! -path "*.git/*" | sed 's/^[^\/]*\///g' | sort)