]> git.xonotic.org Git - xonotic/xonotic.git/blob - all
admin-merge-2: upload report to http://rm.endoftheinternet.org/~nexuiz/xonotic-merge...
[xonotic/xonotic.git] / all
1 #!/bin/sh
2 # vim: filetype=zsh
3
4 set -e
5
6 # I use this in EVERY shell script ;)
7 LF="
8 "
9
10 d00=`pwd`
11 while ! [ -f ./all ]; do
12         if [ x"`pwd`" = x"/" ]; then
13                 echo "Cannot find myself."
14                 echo "Please run this script with the working directory inside a Xonotic checkout."
15                 exit 1
16         fi
17         cd ..
18 done
19 d0=`pwd`
20 SELF="$d0/all"
21
22 # If we are on WINDOWS:
23 case "$0" in
24         all|*/all)
25                 case "`uname`" in
26                         MINGW*|Win*)
27                                 # Windows hates users. So this script has to copy itself elsewhere first...
28                                 tname=
29                                 cp "$SELF" ../all.xonotic.sh
30                                 export WE_HATE_OUR_USERS=1
31                                 exec ../all.xonotic.sh "$@"
32                                 ;;
33                 esac
34                 ;;
35 esac
36
37 msg()
38 {
39         echo "\e[1m$*\e[m"
40 }
41
42 checksum()
43 {
44         if [ -x /usr/bin/md5sum ]; then
45                 /usr/bin/md5sum "$@"
46         elif [ -x /bin/md5sum ]; then
47                 /bin/md5sum "$@"
48         elif [ -x /usr/bin/cksum ]; then
49                 /usr/bin/cksum "$@"
50         else
51                 echo "NOCHECKSUM"
52         fi
53 }
54
55 self=`checksum "$SELF"`
56 checkself()
57 {
58         self_new=`checksum "$SELF"`
59         if [ x"$self" != x"$self_new" ]; then
60                 msg "./all has changed."
61                 if [ -z "$XONOTIC_FORBID_RERUN_ALL" ]; then
62                         msg "Rerunning the requested operation to make sure."
63                         export XONOTIC_FORBID_RERUN_ALL=1
64                         exec "$SELF" "$@"
65                 else
66                         msg "Please try $SELF update, and then retry your requested operation."
67                         exit 1
68                 fi
69         fi
70         return 0
71 }
72
73 verbose()
74 {
75         msg "+ $*"
76         "$@"
77 }
78
79 visible_repo_name()
80 {
81         case "$1" in
82                 .)
83                         echo "the root directory"
84                         ;;
85                 *)
86                         echo "\"$1\""
87                         ;;
88         esac
89 }
90
91 check_mergeconflict()
92 {
93         if git ls-files -u | grep ' 1   '; then
94                 echo
95                 echo "MERGE CONFLICT."
96                 echo "change into the \"$1\" project directory, and then:"
97                 echo "- edit the files mentioned above with your favorite editor,"
98                 echo "  and fix the conflicts (marked with <<<<<<< blocks)"
99                 echo "- for binary files, you can select the files using"
100                 echo "  git checkout --ours or git checkout --theirs"
101                 echo "- when done with a file, 'git add' the file"
102                 echo "- when done, 'git commit'"
103                 echo
104                 exit 1
105         fi
106 }
107
108 yesno()
109 {
110         yesno=
111         while [ x"$yesno" != x"y" -a x"$yesno" != x"n" ]; do
112                 eval "$2"
113                 echo "$1"
114                 IFS= read -r yesno
115         done
116         [ x"$yesno" = x"y" ]
117 }
118
119 enter()
120 {
121         $2 cd "$1"
122         check_mergeconflict "$1"
123 }
124
125 repos_urls="
126 .                             |                                                   | master      |
127 data/xonotic-data.pk3dir      |                                                   | master      |
128 data/xonotic-maps.pk3dir      |                                                   | master      |
129 data/xonotic-music.pk3dir     |                                                   | master      |
130 data/xonotic-nexcompat.pk3dir |                                                   | master      |
131 mediasource                   |                                                   | master      |
132 darkplaces                    |                                                   | div0-stable | svn
133 fteqcc                        | git://github.com/Blub/qclib.git                   | master      |
134 div0-gittools                 | git://git.icculus.org/divverent/div0-gittools.git | master      |
135 netradiant                    |                                                   | master      |
136 "
137 # todo: in darkplaces, change repobranch to div0-stable
138
139 repos=`echo "$repos_urls" | grep . | cut -d '|' -f 1 | tr -d ' '`
140
141 base=`git config remote.origin.url`
142 case "$base" in
143         */xonotic.git)
144                 base=${base%xonotic.git}
145                 ;;
146         *)
147                 echo "The main repo is not xonotic.git, what have you done?"
148                 exit 1
149                 ;;
150 esac
151
152 repourl()
153 {
154         t=`echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 2 | tr -d ' '`
155         if [ -n "$t" ]; then
156                 case "$t" in
157                         *://*)
158                                 echo "$t"
159                                 ;;
160                         *)
161                                 echo "$base$t"
162                                 ;;
163                 esac
164         else
165                 if [ x"$1" = x"." ]; then
166                         echo "$base""xonotic.git"
167                 else
168                         echo "$base${1##*/}.git"
169                 fi
170         fi
171 }
172
173 repobranch()
174 {
175         t=`echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 3 | tr -d ' '`
176         if [ -n "$t" ]; then
177                 echo "$t"
178         else
179                 echo "master"
180         fi
181 }
182
183 repoflags()
184 {
185         echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 4 | tr -d ' '
186         echo "$t"
187 }
188
189 repos=`for d in $repos; do
190         p="${d%dir}"
191         if [ x"$p" = x"$d" ] || [ -d "$d" ] || ! [ -f "$p" ]; then
192                 echo "$d"
193         fi
194 done`
195
196 if [ "$#" = 0 ]; then
197         set -- help
198 fi
199 cmd=$1
200 shift
201
202 case "$cmd" in
203         update|pull)
204                 allow_pull=true
205                 if [ x"$1" = x"-N" ]; then
206                         allow_pull=false
207                 fi
208                 for d in $repos; do
209                         url=`repourl "$d"`
210                         branch=`repobranch "$d"`
211                         if [ -d "$d0/$d" ]; then
212                                 if $allow_pull; then
213                                         enter "$d0/$d" verbose
214                                         verbose git config remote.origin.url "$url"
215                                         verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
216                                                 # TODO remove this line later
217
218                                         verbose git config core.autocrlf false
219                                         verbose git config core.safecrlf false # we don't NEED that...
220
221                                         r=`git symbolic-ref HEAD`
222                                         r=${r#refs/heads/}
223                                         if git config branch.$r.remote >/dev/null 2>&1; then
224                                                 if ! verbose git pull; then
225                                                         check_mergeconflict "$d"
226                                                         echo "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
227                                                         read -r DUMMY
228                                                 fi
229                                         fi
230
231                                         cd "$d00"
232                                         checkself "$cmd" "$@"
233                                         cd "$d0/$d"
234                                         verbose git remote prune origin
235                                         cd "$d0"
236                                 fi
237                         else
238                                 verbose git clone "$url" "$d0/$d"
239                                 enter "$d0/$d" verbose
240                                 verbose git checkout "$branch"
241                                 cd "$d0"
242                         fi
243                 done
244                 ;;
245         checkout|switch)
246                 remote=$1
247                 branch=$2
248                 if [ -z "$branch" ]; then
249                         branch=$remote
250                         remote=origin
251                 fi
252                 exists=false
253                 for d in $repos; do
254                         enter "$d0/$d" verbose
255                         if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
256                                 exists=true
257                                 verbose git checkout "$branch"
258                         elif git rev-parse "refs/remotes/$remote/$branch" >/dev/null 2>&1; then
259                                 exists=true
260                                 verbose git checkout --track -b "$branch" "$remote/$branch"
261                         else
262                                 verbose git checkout "`repobranch "$d"`"
263                         fi
264                         cd "$d00"
265                         checkself "$cmd" "$@"
266                         cd "$d0"
267                 done
268                 if ! $exists; then
269                         echo "The requested branch was not found in any repository."
270                 fi
271                 exec "$SELF" branch
272                 ;;
273         branch)
274                 remote=$1
275                 branch=$2
276                 srcbranch=$3
277                 if [ -z "$branch" ]; then
278                         branch=$remote
279                         remote=origin
280                 fi
281                 if [ -z "$branch" ]; then
282                         for d in $repos; do
283                                 enter "$d0/$d"
284                                 r=`git symbolic-ref HEAD`
285                                 r=${r#refs/heads/}
286                                 echo "$d is at $r"
287                                 cd "$d0"
288                         done
289                 else
290                         for d in $repos; do
291                                 dv=`visible_repo_name "$d"`
292                                 enter "$d0/$d" verbose
293                                 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
294                                         echo "Already having this branch in $dv."
295                                 else
296                                         if yesno "Branch in $dv?"; then
297                                                 if [ -n "$srcbranch" ]; then
298                                                         b=$srcbranch
299                                                 else
300                                                         b="`repobranch "$d"`"
301                                                 fi
302                                                 # TODO do this without pushing
303                                                 verbose git push "$remote" "$b":"$branch"
304                                                 verbose git checkout --track -b "$branch" "$remote/$branch"
305                                         fi
306                                 fi
307                                 cd "$d0"
308                         done
309                         "$SELF" branch
310                 fi
311                 ;;
312         branches)
313                 for d in $repos; do
314                         enter "$d0/$d"
315                         echo "In $d:"
316                         git branch -a -v -v | cut -c 3- | while read -r BRANCH REV UPSTREAM TEXT; do
317                                 case "$UPSTREAM" in
318                                         \[*)
319                                                 UPSTREAM=${UPSTREAM#\[}
320                                                 UPSTREAM=${UPSTREAM%\]}
321                                                 UPSTREAM=${UPSTREAM%:*}
322                                                 ;;
323                                         *)
324                                                 TEXT="$UPSTREAM $TEXT"
325                                                 UPSTREAM=
326                                                 ;;
327                                 esac
328                                 if [ x"$REV" = x"->" ]; then
329                                         continue
330                                 fi
331                                 BRANCH=${BRANCH#remotes/}
332                                 echo -n "  $BRANCH"
333                                 if [ -n "$UPSTREAM" ]; then
334                                         echo -n " (tracking $UPSTREAM)"
335                                 fi
336                                 #echo " $TEXT"
337                                 echo
338                         done
339                 done
340                 ;;
341         branches_short)
342                 for d in $repos; do
343                         cd "$d0/$d" # am in a pipe, shouldn't use enter
344                         git branch -a -v -v | cut -c 3- | sed "s,^,$d ,"
345                         cd "$d0"
346                 done | {
347                         branches_list=
348                         # branches_repos_*=
349                         while read -r d BRANCH REV UPSTREAM TEXT; do
350                                 case "$UPSTREAM" in
351                                         \[*)
352                                                 UPSTREAM=${UPSTREAM#\[}
353                                                 UPSTREAM=${UPSTREAM%\]}
354                                                 UPSTREAM=${UPSTREAM%:*}
355                                                 ;;
356                                         *)
357                                                 TEXT="$UPSTREAM $TEXT"
358                                                 UPSTREAM=
359                                                 ;;
360                                 esac
361                                 if [ x"$REV" = x"->" ]; then
362                                         continue
363                                 fi
364                                 BRANCH=${BRANCH#remotes/}
365                                 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
366                                 branches_list="$branches_list $BRANCH" # TEH SORT MAKEZ IT UNIEQ
367                                 eval "r=\$branches_repos_$ID"
368                                 r="$r $d:$UPSTREAM"
369                                 eval "branches_repos_$ID=\$r"
370                         done
371                         echo -n "$branches_list" | xargs -n 1 echo | sort -u | while IFS= read -r BRANCH; do
372                                 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
373                                 eval "r=\$branches_repos_$ID"
374                                 echo "$BRANCH: $r"
375                         done
376                 }
377                 ;;
378         merge)
379                 for d in $repos; do
380                         dv=`visible_repo_name "$d"`
381                         enter "$d0/$d" verbose
382                         r=`git symbolic-ref HEAD`
383                         r=${r#refs/heads/}
384                         if git log HEAD..origin/"`repobranch "$d"`" | grep .; then
385                                 # we have uncommitted changes
386                                 if yesno "Could merge from \"`repobranch "$d"`\" into \"$r\" in $dv. Do it?"; then
387                                         if ! verbose git merge origin/"`repobranch "$d"`"; then
388                                                 check_mergeconflict "$d"
389                                                 exit 1 # this should ALWAYS be fatal
390                                         fi
391                                 fi
392                         fi
393                         cd "$d0"
394                 done
395                 ;;
396         push|commit)
397                 submit=$1
398                 for d in $repos; do
399                         dv=`visible_repo_name "$d"`
400                         enter "$d0/$d" verbose
401                         r=`git symbolic-ref HEAD`
402                         r=${r#refs/heads/}
403                         if git diff HEAD | grep .; then
404                                 # we have uncommitted changes
405                                 if yesno "Uncommitted changes in \"$r\" in $dv. Commit?"; then
406                                         verbose git commit -a
407                                 fi
408                         fi
409                         rem=`git config "branch.$r.remote" || echo origin`
410                         if { git log "$rem/$r".."$r" || git log origin/"`repobranch "$d"`".."$r"; } | grep .; then
411                                 if yesno "Push \"$r\" in $dv?"; then
412                                         verbose git push "$rem" HEAD
413                                 fi
414                         fi
415                         if [ x"$submit" = x"-s" ]; then
416                                 case "$r" in
417                                         */*)
418                                                 verbose git push "$rem" HEAD:"${r%%/*}/finished/${r#*/}"
419                                                 ;;
420                                 esac
421                         fi
422                         cd "$d0"
423                 done
424                 ;;
425         compile)
426                 if [ -n "$WE_HATE_OUR_USERS" ]; then
427                         TARGETS="sv-debug cl-debug"
428                 else
429                         TARGETS="sv-debug cl-debug sdl-debug"
430                 fi
431                 case "$1" in
432                         -c)
433                                 clean=true
434                                 shift
435                                 ;;
436                         *)
437                                 clean=false
438                                 ;;
439                 esac
440                 case "$1" in
441                         sdl)
442                                 TARGETS="sdl-debug"
443                                 shift
444                                 ;;
445                         glx|agl|wgl)
446                                 TARGETS="cl-debug"
447                                 shift
448                                 ;;
449                         dedicated)
450                                 TARGETS="sv-debug"
451                                 shift
452                                 ;;
453                 esac
454                 if [ -z "$MAKEFLAGS" ]; then
455                         if [ -f /proc/cpuinfo ]; then
456                                 ncpus=$((`grep -c '^processor   :' /proc/cpuinfo`+0))
457                                 if [ $ncpus -gt 1 ]; then
458                                         MAKEFLAGS=-j$ncpus
459                                 fi
460                         fi
461                         case "`uname`" in
462                                 Linux|*BSD)
463                                         MAKEFLAGS="$MAKEFLAGS DP_LINK_TO_LIBJPEG=1"
464                                         ;;
465                         esac
466                         if [ -n "$WE_HATE_OUR_USERS" ]; then
467                                 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw"
468                         fi
469                 fi
470                 enter "$d0/fteqcc" verbose
471                 if $clean; then
472                         verbose make $MAKEFLAGS clean
473                 fi
474                 verbose make $MAKEFLAGS
475                 enter "$d0/data/xonotic-data.pk3dir" verbose
476                 if $clean; then
477                         verbose make $MAKEFLAGS clean
478                 fi
479                 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
480                 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
481                 enter "$d0/darkplaces" verbose
482                 if $clean; then
483                         verbose make $MAKEFLAGS clean
484                 fi
485                 for T in $TARGETS; do
486                         verbose make $MAKEFLAGS "$@" "$T"
487                 done
488                 ;;
489         run)
490                 if [ -n "$WE_HATE_OUR_USERS" ]; then
491                         client=
492                         export PATH="$d0/misc/buildfiles/w32:$PATH"
493                 elif [ x"`uname`" = x"Darwin" ]; then
494                         export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Nexuiz.app/Contents/MacOS"
495                         client=-sdl
496                 else
497                         client=-sdl
498                 fi
499                 case "$1" in
500                         sdl|glx|agl|dedicated)
501                                 client=-$1
502                                 shift
503                                 ;;
504                         wgl)
505                                 client=
506                                 shift
507                                 ;;
508                 esac
509                 if ! [ -x "darkplaces/darkplaces$client" ]; then
510                         if [ -x "darkplaces/darkplaces$client.exe" ]; then
511                                 client=$client.exe
512                         else
513                                 echo "Client darkplaces/darkplaces$client not found, aborting"
514                                 exit 1
515                         fi
516                 fi
517                 set -- "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic "$@"
518
519                 # if pulseaudio is running: USE IT
520                 if ps -C pulseaudio >/dev/null; then
521                         if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
522                                 export SDL_AUDIODRIVER=pulse
523                         fi
524                 fi
525
526                 if [ -n "$USE_GDB" ]; then
527                         set -- gdb --args "$@"
528                 fi
529                 "$@"
530                 ;;
531         each|foreach)
532                 for d in $repos; do
533                         if verbose cd "$d0/$d"; then
534                                 verbose "$@"
535                                 cd "$d0"
536                         fi
537                 done
538                 ;;
539         save-patches)
540                 outfile=$1
541                 patchdir=`mktemp -d -t save-patches.XXXXXX`
542                 for d in $repos; do
543                         enter "$d0/$d" verbose
544                         git branch -v -v | cut -c 3- | {
545                                 i=0
546                                 while read -r BRANCH REV UPSTREAM TEXT; do
547                                         case "$UPSTREAM" in
548                                                 \[*)
549                                                         UPSTREAM=${UPSTREAM#\[}
550                                                         UPSTREAM=${UPSTREAM%\]}
551                                                         UPSTREAM=${UPSTREAM%:*}
552                                                         TRACK=true
553                                                         ;;
554                                                 *)
555                                                         UPSTREAM=origin/"`repobranch "$d"`"
556                                                         TRACK=false
557                                                         ;;
558                                         esac
559                                         if [ x"$REV" = x"->" ]; then
560                                                 continue
561                                         fi
562                                         if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then
563                                                 echo "$d" > "$patchdir/$i/info.txt"
564                                                 echo "$BRANCH" >> "$patchdir/$i/info.txt"
565                                                 echo "$UPSTREAM" >> "$patchdir/$i/info.txt"
566                                                 echo "$TRACK" >> "$patchdir/$i/info.txt"
567                                                 i=$(($i+1))
568                                         else
569                                                 rm -rf "$patchdir/$i"
570                                         fi
571                                 done
572                         }
573                 done
574                 ( cd "$patchdir" && tar cvzf - . ) > "$outfile"
575                 rm -rf "$patchdir"
576                 ;;
577         restore-patches)
578                 infile=$1
579                 patchdir=`mktemp -d -t restore-patches.XXXXXX`
580                 ( cd "$patchdir" && tar xvzf - ) < "$infile"
581                 # detach the head
582                 for P in "$patchdir"/*/info.txt; do
583                         D=${P%/info.txt}
584                         exec 3<"$P"
585                         read -r d <&3
586                         read -r BRANCH <&3
587                         read -r UPSTREAM <&3
588                         read -r TRACK <&3
589                         verbose git checkout HEAD^0
590                         verbose git branch -D "$BRANCH"
591                         if [ x"$TRACK" = x"true" ]; then
592                                 verbose git checkout --track -b "$BRANCH" "$UPSTREAM"
593                         else
594                                 verbose git branch -b "$BRANCH" "$UPSTREAM"
595                         fi
596                         verbose git am "$D"
597                 done
598                 rm -rf "$patchdir"
599                 ;;
600         admin-merge)
601                 if [ "$#" = 1 ]; then
602                         set -- "${1%%/*}" "${1#*/}"
603                 fi
604                 for d in $repos; do
605                         enter "$d0/$d" verbose
606                         git rev-parse "$1/$2" || continue
607                         # 1. review
608                         {
609                                 git log HEAD.."$1/$2"
610                                 git diff HEAD..."$1/$2"
611                         } | less
612                         if yesno "Merge \"$1/$2\" into `git symbolic-ref HEAD` of $d?"; then
613                                 git merge "$1/$2"
614                                 if "$SELF" compile && yesno "Still merge \"$1/$2\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
615                                         git push origin HEAD
616                                         git push "$1" :"$2"
617                                 else
618                                         git reset --hard HEAD@{1}
619                                 fi
620                         fi
621                 done
622                 ;;
623         admin-merge-2)
624                 t=`mktemp`
625                 report=""
626                 reportecho()
627                 {
628                         report=$report"$*$LF"
629                         echo "$*"
630                 }
631                 reportecho4()
632                 {
633                         report=$report"    $*$LF"
634                         echo "    $*"
635                 }
636                 reportdo4()
637                 {
638                         o=`"$@" | sed 's/^/    /' || true`
639                         reportecho "$o"
640                 }
641                 for d in $repos; do
642                         enter "$d0/$d" verbose
643                         reportecho "In $d:"
644                         for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
645                                 case "${ref#refs/remotes/origin/}" in
646                                         "`repobranch "$d"`")
647                                                 continue
648                                                 ;;
649                                         HEAD|master)
650                                                 continue
651                                                 ;;
652                                 esac
653                                 reportecho "  Branch $ref:"
654                                 note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
655                                 if [ -n "$note" ]; then
656                                         reportdo4 echo "$note"
657                                         reportecho4 "--> not merging, already had this one rejected before"
658                                 elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ git log HEAD.."$ref"; git diff HEAD..."$ref"; } | less'; then
659                                         git checkout master
660                                         org=`git rev-parse HEAD`
661                                         if ! git merge "$ref" 2>&1 | tee "$t"; then
662                                                 git reset --hard "$org"
663                                                 git notes --ref "refs/notes/admin-merge" add -m "Merge failed:$LF`cat "$t"`" "$ref"
664                                                 reportdo4 cat "$t"
665                                                 reportecho4 "--> merge failed"
666                                         elif ! "$SELF" compile 2>&1 | tee "$t"; then
667                                                 git reset --hard "$org"
668                                                 git notes --ref "refs/notes/admin-merge" add -m "Compile failed:$LF`cat "$t"`" "$ref"
669                                                 reportdo4 cat "$t"
670                                                 reportecho4 "--> compile failed"
671                                         elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
672                                                 git reset --hard "$org"
673                                                 git notes --ref "refs/notes/admin-merge" add "$ref"
674                                                 note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
675                                                 reportdo4 echo "$note"
676                                                 reportecho4 "--> test failed"
677                                         else
678                                                 case ",`repoflags "$d"`," in
679                                                         *,svn,*)
680                                                                 git pull
681                                                                 git rebase -i "$org"
682                                                                 git svn dcommit --add-author-from
683                                                                 ;;
684                                                         *)
685                                                                 git push origin HEAD
686                                                                 ;;
687                                                 esac
688                                                 reportecho4 "--> MERGED"
689                                                 if yesno "Delete original branch \"$ref\"?"; then
690                                                         git push origin :"${ref#refs/remotes/origin/}"
691                                                         reportecho4 "--> branch deleted"
692                                                 fi
693                                         fi
694                                 else
695                                         git notes --ref "refs/notes/admin-merge" add "$ref"
696                                         note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
697                                         if [ -n "$note" ]; then
698                                                 reportdo4 echo "$note"
699                                                 reportecho4 "--> rejected"
700                                         else
701                                                 reportecho4 "--> postponed"
702                                         fi
703                                 fi
704                                 reportecho ""
705                         done
706                         reportecho ""
707                 done
708                 rm -f "$t"
709                 echo "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
710                 ;;
711         *)
712                 echo "Usage:"
713                 echo "  $SELF pull"
714                 echo "  $SELF merge"
715                 echo "  $SELF push [-s]"
716                 echo "  $SELF branches"
717                 echo "  $SELF branch [<remote>] <branchname>"
718                 echo "  $SELF branch <remote> <branchname> <srcbranchname>"
719                 echo "  $SELF checkout [<remote>] <branchname>"
720                 echo "  $SELF compile [-c] [<client>] <options>"
721                 echo "  $SELF run [<client>] <options>"
722                 echo "  $SELF each <command>"
723                 ;;
724 esac