prefix=
suffix=
case "$1" in
+ # have to detect some rev-parse syntax
*..*)
first=${1%%..*}
rest=${1#*..}
first=`processarg "$first"`
echo "^$first"
;;
+ # handle foo@@bar so that if foo exists, foo stays, otherwise bar
*$SEPARATOR*)
first=${1%%$SEPARATOR*}
rest=${1#*$SEPARATOR}
processarg "$rest"
fi
;;
+ # other args stay as is
*)
echo "$1"
;;