#!/bin/sh VC_TYPE="unset" # Initialize VC_TYPE in the cheapest possible way. # # Note: this one-liner is also used in the 'logup' script, so now # it's duplicated here. In the interest of all the scripts in # https://svn.red-bean.com/repos/kfogel/trunk/bin/ remaining useable # as standalone downloads, I'm not abstracting this out to a library, # but might reconsider that if it gets used in a third script. if svn info > /dev/null 2>&1; then VC_TYPE="svn"; else VC_TYPE="git"; fi if [ ${VC_TYPE} = "svn" ]; then svn st $* if [ "`pwd`" = "${HOME}" ]; then # Handle upshifted subdirs in my home directory. The right way to # do this would involve comparing SVN URLs and just running status # on the ones that are disjoint, but I'm too lazy to do that. echo "(Some items may be listed twice.)" for name in */.svn; do svn st $* `dirname ${name}` done fi elif [ ${VC_TYPE} = "git" ]; then git status else # Impossible right now, but let's plan ahead: echo "ERROR: unrecognized version control system '${VC_TYPE}'" exit 1 fi