Skip to content

Instantly share code, notes, and snippets.

@naholyr
Created February 15, 2012 15:41
Show Gist options
  • Save naholyr/1836765 to your computer and use it in GitHub Desktop.
Save naholyr/1836765 to your computer and use it in GitHub Desktop.
List all ignored files
# I didn't look, but I'm even pretty sure there is a dedicated command for this with Git.
# and this is just a piece of cake, 5 minutes max to implement this...
# Edit - actually, you can simply call this:
# git ls-files --others --ignored --exclude-standard
find -name .gitignore | while read f
do
d="$(dirname "$f")"
cat $f | while read p
do
if (echo "$p" | grep -v '^ *$' &> /dev/null)
then
echo "$d/$p"
fi
done
done | while read p
do
eval "ls -d $p" 2> /dev/null
done
# about 2 hours of shitty brain-twisting work
svn propget --xml --recursive svn:ignore . | while IFS=\> read -d \< ENTITY CONTENT
do
if (echo "$ENTITY" | grep '^target' &> /dev/null)
then
TARGET="$(echo "$ENTITY" | grep -o 'path=".*"' | sed 's/path="\(.*\)"/\1/')"
if [ "$TARGET" = "" ]
then
TARGET="."
fi
elif (echo "$ENTITY" | grep '^property' &> /dev/null)
then
PROP="$(echo "$ENTITY" | grep -o 'name=".*"' | sed 's/name="\(.*\)"/\1/')"
if [ "$PROP" = "svn:ignore" ]
then
echo $CONTENT | while read P
do
if (echo "$P" | grep -v '^ *$' &> /dev/null)
then
echo "$TARGET/$P"
fi
done
fi
fi
done | while read p
do
eval "ls -d $p" 2> /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment