+ git branch -a | sed 's/^/ /; /->/d'
+ cd "$d0"
+ done
+ ;;
+ merge)
+ for d in $repos; do
+ cd "$d0/$d"
+ r=`git symbolic-ref HEAD`
+ r=${r#refs/heads/}
+ if git log HEAD..origin/master | grep .; then
+ # we have uncommitted changes
+ a=
+ while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
+ echo "Could merge from \"master\" into \"$r\" in \"$d\". Do it?"
+ read -r a
+ done
+ if [ x"$a" = x"y" ]; then
+ if ! verbose git merge origin/master; then
+ echo
+ echo "MERGE CONFLICT."
+ echo "change into the \"$d\" project directory, and then:"
+ echo "- edit the files mentioned above with your favorite editor,"
+ echo " and fix the conflicts (marked with <<<<<<< blocks)"
+ echo "- when done with a file, 'git add' the file"
+ echo "- when done, 'git commit'"
+ exit 1
+ fi
+ fi
+ fi
+ cd "$d0"
+ done
+ ;;
+ push)
+ for d in $repos; do
+ cd "$d0/$d"
+ r=`git symbolic-ref HEAD`
+ r=${r#refs/heads/}
+ if git diff HEAD | grep .; then
+ # we have uncommitted changes
+ a=
+ while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
+ echo "Uncommitted changes in \"$r\" in \"$d\". Commit?"
+ read -r a
+ done
+ if [ x"$a" = x"y" ]; then
+ verbose git commit -a
+ fi
+ fi
+ if git log "origin/$r".."$r" | grep .; then
+ a=
+ while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
+ echo "Push \"$r\" in \"$d\"?"
+ read -r a
+ done
+ if [ x"$a" = x"y" ]; then
+ verbose git push `git config "branch.$r.remote" || echo origin` HEAD
+ fi
+ fi
+ cd "$d0"
+ done
+ ;;
+ compile)
+ if [ -z "$MAKEFLAGS" ]; then
+ if [ -f /proc/cpuinfo ]; then
+ ncpus=$((`grep -c '^processor :' /proc/cpuinfo`+0))
+ if [ $ncpus -gt 1 ]; then
+ MAKEFLAGS=-j$ncpus
+ fi
+ fi
+ fi
+ verbose cd "$d0/fteqcc"
+ verbose make $MAKEFLAGS
+ verbose cd "$d0/data/xonotic-data.pk3dir"
+ verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" $MAKEFLAGS
+ verbose cd "$d0/darkplaces"
+ verbose make $MAKEFLAGS sv-debug
+ verbose make $MAKEFLAGS cl-debug
+ verbose make $MAKEFLAGS sdl-debug
+ ;;
+ run)
+ client=-sdl
+ case "$1" in
+ sdl|glx|agl|dedicated)
+ client=-$1
+ shift
+ ;;
+ wgl)
+ client=
+ shift
+ ;;
+ esac
+ if ! [ -x "darkplaces/darkplaces$client" ]; then
+ if [ -x "darkplaces/darkplaces$client.exe" ]; then
+ client=$client.exe
+ else
+ echo "Client darkplaces/darkplaces$client not found, aborting"
+ exit 1
+ fi
+ fi
+ #verbose "darkplaces/darkplaces$client" -xonotic "$@"
+ verbose "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic "$@"
+ ;;
+ each|foreach)
+ for d in $repos; do
+ verbose cd "$d0/$d"
+ verbose "$@"