3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 USAGE
="[-a|-A] [-c|-C] [-d|-D] [-m|-M] [-r|-R] [-t|-T] [-u|-U] [-x|-X] [-n]"
11 while [ $# -gt 0 ]; do
14 DIFF_FILTER
="A$DIFF_FILTER"
17 DIFF_FILTER
="C$DIFF_FILTER"
20 DIFF_FILTER
="D$DIFF_FILTER"
23 DIFF_FILTER
="M$DIFF_FILTER"
26 DIFF_FILTER
="R$DIFF_FILTER"
29 DIFF_FILTER
="T$DIFF_FILTER"
32 DIFF_FILTER
="U$DIFF_FILTER"
36 DIFF_FILTER
="X$DIFF_FILTER"
48 # default status displays all
49 if [ -z "$DIFF_FILTER" ]; then
54 git-rev-parse
--verify HEAD
>/dev
/null
2>&1 || IS_INITIAL
=t
58 if [ -z "$no_prefix" ] ; then
69 while read status name newname
72 A
*) echo "$Apfx$name";;
73 C
*) echo "$Cpfx$name -> $newname";;
74 D
*) echo "$Dpfx$name";;
75 M
) echo "$Mpfx$name";;
76 R
*) echo "$Rpfx$name -> $newname";;
77 T
) echo "$Tpfx$name";;
78 U
) echo "$Upfx$name";;
79 ?
) echo "$Xpfx$name";;
87 # untracked; FIXME: there's got to be a better way
88 if [ ! -z "$untracked" ]; then
89 if [ -f "$GIT_DIR/info/exclude" ]; then
90 git-ls-files
-z --others \
91 --exclude-from="$GIT_DIR/info/exclude" \
92 --exclude-per-directory=.gitignore
94 git-ls-files
-z --others --exclude-per-directory=.gitignore
95 fi |
xargs -0 -L 1 echo |
while read n
; do
96 [ -z "$n" ] && continue
97 echo "$n" |
sed -e "s/^/?\t/"
102 if [ -z "$IS_INITIAL" ]; then
104 git-diff-index
-M --name-status --diff-filter=$DIFF_FILTER HEAD
107 git-ls-files |
sed -e "s/^/A\t/"