Skip to content

Instantly share code, notes, and snippets.

@randomekek
Last active December 11, 2015 23:48
Show Gist options
  • Save randomekek/4678996 to your computer and use it in GitHub Desktop.
Save randomekek/4678996 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -n "$(svn st | egrep '^A|M' | awk '{print$2}' | xargs cat | grep -i '@todo')" ]; then
echo 'There are TODOs:';
svn st | egrep '^A|M' | awk '{print$2}' | while read filename; do
if [ -n "$(cat $filename | head -c 100000 | grep -i '@todo')" ]; then
echo $filename
cat $filename | head -c 100000 | grep -i '@todo' | awk '{ sub(/^[ *]*/, "", $0); print " > " $0 }'
echo
fi
done
else
svn ci
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment