+ $ECHO "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
+ ;;
+ clean)
+ "$SELF" fix_config
+ "$SELF" update -N
+ force=false
+ gotoupstream=false
+ fetchupstream=false
+ gotomaster=false
+ rmuntracked=false
+ killbranches=false
+ # usage:
+ # ./all clean [-m] [-f | -fu | -fU] [-r] [-D]
+ # ./all clean --reclone
+ found=false
+ for X in "$@"; do
+ if [ x"$X" = x"--reclone" ]; then
+ force=true
+ fetchupstream=true
+ gotoupstream=true
+ gotomaster=true
+ rmuntracked=true
+ killbranches=true
+ elif [ x"$X" = x"-f" ]; then
+ force=true
+ elif [ x"$X" = x"-u" ]; then
+ gotoupstream=true
+ elif [ x"$X" = x"-U" ]; then
+ gotoupstream=true
+ fetchupstream=true
+ elif [ x"$X" = x"-fu" ]; then
+ force=true
+ gotoupstream=true
+ elif [ x"$X" = x"-fU" ]; then
+ force=true
+ gotoupstream=true
+ fetchupstream=true
+ elif [ x"$X" = x"-m" ]; then
+ gotomaster=true
+ elif [ x"$X" = x"-r" ]; then
+ rmuntracked=true
+ elif [ x"$X" = x"-D" ]; then
+ killbranches=true
+ elif $ECHO "$X" | grep '^-FFFF*UUUU*$' >/dev/null; then
+ msg ''
+ msg " _____"
+ msg " ,--'-\\P/\`\\ FFFFFFF"
+ msg " __/_ B/,-.\\ FFFFFFF"
+ msg " / _\\ (// O\\\\ FFFFFF"
+ msg "| (O \`) _\\._ _)\\ FFFUU"
+ msg "| |___/.^d0~~\"\\ \\ UUUU"
+ msg "| |\`~' \\ | UUUU"
+ msg "| | __,C>|| UUUU"
+ msg "\\ /_ ,-/,-' | UUUU"
+ msg " \\\\_ \\_>~' / UUUU-"
+ msg ''
+ else
+ msg "Unknown arg: $X"
+ fi
+ found=true
+ shift
+ done
+ if ! $found; then
+ rmuntracked=true
+ fi
+ for d in $repos; do
+ verbose cd "$d0/$d"
+ if $gotoupstream; then
+ if ! $force; then
+ msg "Must also use -f (delete local changes) when using -u"
+ exit 1
+ fi
+ if $gotomaster; then
+ if $fetchupstream; then
+ verbose git fetch origin
+ verbose git remote prune origin
+ fi
+ verbose git checkout -f "`repobranch "$d"`"
+ verbose git reset --hard origin/"`repobranch "$d"`"
+ else
+ r=`git symbolic-ref HEAD`
+ r=${r#refs/heads/}
+ rem=`git config "branch.$r.remote" || $ECHO origin`
+ bra=`git config "branch.$r.merge" || $ECHO "$r"`
+ upstream="$rem/${bra#refs/heads/}"
+ if $fetchupstream; then
+ verbose git fetch "$rem"
+ verbose git remote prune "$rem"
+ fi
+ if ! git rev-parse "$upstream" >/dev/null 2>&1; then
+ upstream="origin/`repobranch "$d"`"
+ fi
+ verbose git reset --hard "$upstream"
+ fi
+ elif $gotomaster; then
+ if $force; then
+ verbose git checkout -f "`repobranch "$d"`"
+ verbose git reset --hard
+ else
+ verbose git checkout "`repobranch "$d"`"
+ fi
+ elif $force; then
+ verbose git reset --hard
+ fi
+ if $rmuntracked; then
+ case "$d" in
+ .)
+ verbose git clean -df || true
+ ;;
+ *)
+ verbose git clean -xdf || true
+ ;;
+ esac
+ fi
+ if $killbranches; then
+ git for-each-ref --format='%(refname)' refs/heads/ | while IFS= read -r B; do
+ if [ x"$B" != x"`git symbolic-ref HEAD`" ]; then
+ verbose git branch -D "${B#refs/heads/}"
+ fi
+ done
+ git rev-parse refs/heads/master >/dev/null 2>&1 || verbose git branch --track master origin/master || true
+ git rev-parse "refs/heads/`repobranch "$d"`" >/dev/null 2>&1 || verbose git branch --track "`repobranch "$d"`" origin/"`repobranch "$d"`" || true
+ fi
+ checkself "$cmd" "$@"
+ done