5 # TODO this logic should probably rather be in rev-parse itself
7 # whenever an expression foo@@bar is used as an argument
8 # it checks whether foo is a valid reference, and if not, bar is used instead
17 first=`processarg "$first"`
18 rest=`processarg "$rest"`
24 first=`processarg "$first"`
30 first=`processarg "$first"`
36 first=`processarg "$first"`
42 first=`processarg "$first"`
47 first=`processarg "$first"`
51 first=${1%%$SEPARATOR*}
53 if git rev-parse "$first" >/dev/null 2>&1; then
73 set -- "$@" "`processarg "$X"`"
75 echo >&2 "In `pwd`: $*"
79 # recurse through all sub-repos
81 for GITDIR in `find . -type d -name \*.git`; do
82 # TODO I would LIKE to do this, but then some commands (like pull) fail
83 #export GIT_DIR="$GITDIR"
84 #export GIT_WORK_TREE="${GITDIR%/.git}"
85 # so I will have to chdir instead
87 ( cd "$GITDIR/.." && processargs git "$@" )
88 if [ "$?" -gt "$status" ]; then