]> git.xonotic.org Git - xonotic/xonotic.git/blob - all
fix useless warning on pulseaudio check on Windows :P
[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 [ -z "$branch" ]; then
256                                 b=`repobranch "$d"`
257                         else
258                                 b=$branch
259                         fi
260                         if git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
261                                 exists=true
262                                 verbose git checkout "$b"
263                         elif git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
264                                 exists=true
265                                 verbose git checkout --track -b "$b" "$remote/$b"
266                         else
267                                 verbose git checkout "`repobranch "$d"`"
268                         fi
269                         cd "$d00"
270                         checkself "$cmd" "$@"
271                         cd "$d0"
272                 done
273                 if ! $exists; then
274                         echo "The requested branch was not found in any repository."
275                 fi
276                 exec "$SELF" branch
277                 ;;
278         branch)
279                 remote=$1
280                 branch=$2
281                 srcbranch=$3
282                 if [ -z "$branch" ]; then
283                         branch=$remote
284                         remote=origin
285                 fi
286                 if [ -z "$branch" ]; then
287                         for d in $repos; do
288                                 enter "$d0/$d"
289                                 r=`git symbolic-ref HEAD`
290                                 r=${r#refs/heads/}
291                                 echo "$d is at $r"
292                                 cd "$d0"
293                         done
294                 else
295                         for d in $repos; do
296                                 dv=`visible_repo_name "$d"`
297                                 enter "$d0/$d" verbose
298                                 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
299                                         echo "Already having this branch in $dv."
300                                 else
301                                         if yesno "Branch in $dv?"; then
302                                                 if [ -n "$srcbranch" ]; then
303                                                         b=$srcbranch
304                                                 else
305                                                         b="`repobranch "$d"`"
306                                                 fi
307                                                 # TODO do this without pushing
308                                                 verbose git push "$remote" "$b":"$branch"
309                                                 verbose git checkout --track -b "$branch" "$remote/$branch"
310                                         fi
311                                 fi
312                                 cd "$d0"
313                         done
314                         "$SELF" branch
315                 fi
316                 ;;
317         branches)
318                 for d in $repos; do
319                         enter "$d0/$d"
320                         echo "In $d:"
321                         git branch -a -v -v | cut -c 3- | while read -r BRANCH REV UPSTREAM TEXT; do
322                                 case "$UPSTREAM" in
323                                         \[*)
324                                                 UPSTREAM=${UPSTREAM#\[}
325                                                 UPSTREAM=${UPSTREAM%\]}
326                                                 UPSTREAM=${UPSTREAM%:*}
327                                                 ;;
328                                         *)
329                                                 TEXT="$UPSTREAM $TEXT"
330                                                 UPSTREAM=
331                                                 ;;
332                                 esac
333                                 if [ x"$REV" = x"->" ]; then
334                                         continue
335                                 fi
336                                 BRANCH=${BRANCH#remotes/}
337                                 echo -n "  $BRANCH"
338                                 if [ -n "$UPSTREAM" ]; then
339                                         echo -n " (tracking $UPSTREAM)"
340                                 fi
341                                 #echo " $TEXT"
342                                 echo
343                         done
344                 done
345                 ;;
346         branches_short)
347                 for d in $repos; do
348                         cd "$d0/$d" # am in a pipe, shouldn't use enter
349                         git branch -a -v -v | cut -c 3- | sed "s,^,$d ,"
350                         cd "$d0"
351                 done | {
352                         branches_list=
353                         # branches_repos_*=
354                         while read -r d BRANCH REV UPSTREAM TEXT; do
355                                 case "$UPSTREAM" in
356                                         \[*)
357                                                 UPSTREAM=${UPSTREAM#\[}
358                                                 UPSTREAM=${UPSTREAM%\]}
359                                                 UPSTREAM=${UPSTREAM%:*}
360                                                 ;;
361                                         *)
362                                                 TEXT="$UPSTREAM $TEXT"
363                                                 UPSTREAM=
364                                                 ;;
365                                 esac
366                                 if [ x"$REV" = x"->" ]; then
367                                         continue
368                                 fi
369                                 BRANCH=${BRANCH#remotes/}
370                                 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
371                                 branches_list="$branches_list $BRANCH" # TEH SORT MAKEZ IT UNIEQ
372                                 eval "r=\$branches_repos_$ID"
373                                 r="$r $d:$UPSTREAM"
374                                 eval "branches_repos_$ID=\$r"
375                         done
376                         echo -n "$branches_list" | xargs -n 1 echo | sort -u | while IFS= read -r BRANCH; do
377                                 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
378                                 eval "r=\$branches_repos_$ID"
379                                 echo "$BRANCH: $r"
380                         done
381                 }
382                 ;;
383         merge)
384                 for d in $repos; do
385                         dv=`visible_repo_name "$d"`
386                         enter "$d0/$d" verbose
387                         r=`git symbolic-ref HEAD`
388                         r=${r#refs/heads/}
389                         if git log HEAD..origin/"`repobranch "$d"`" | grep .; then
390                                 # we have uncommitted changes
391                                 if yesno "Could merge from \"`repobranch "$d"`\" into \"$r\" in $dv. Do it?"; then
392                                         if ! verbose git merge origin/"`repobranch "$d"`"; then
393                                                 check_mergeconflict "$d"
394                                                 exit 1 # this should ALWAYS be fatal
395                                         fi
396                                 fi
397                         fi
398                         cd "$d0"
399                 done
400                 ;;
401         push|commit)
402                 submit=$1
403                 for d in $repos; do
404                         dv=`visible_repo_name "$d"`
405                         enter "$d0/$d" verbose
406                         r=`git symbolic-ref HEAD`
407                         r=${r#refs/heads/}
408                         if git diff HEAD | grep .; then
409                                 # we have uncommitted changes
410                                 if yesno "Uncommitted changes in \"$r\" in $dv. Commit?"; then
411                                         verbose git commit -a
412                                 fi
413                         fi
414                         rem=`git config "branch.$r.remote" || echo origin`
415                         if { git log "$rem/$r".."$r" || git log origin/"`repobranch "$d"`".."$r"; } | grep .; then
416                                 if yesno "Push \"$r\" in $dv?"; then
417                                         verbose git push "$rem" HEAD
418                                 fi
419                         fi
420                         if [ x"$submit" = x"-s" ]; then
421                                 case "$r" in
422                                         */*)
423                                                 verbose git push "$rem" HEAD:"${r%%/*}/finished/${r#*/}"
424                                                 ;;
425                                 esac
426                         fi
427                         cd "$d0"
428                 done
429                 ;;
430         compile)
431                 if [ -n "$WE_HATE_OUR_USERS" ]; then
432                         TARGETS="sv-debug cl-debug"
433                 else
434                         TARGETS="sv-debug cl-debug sdl-debug"
435                 fi
436                 case "$1" in
437                         -c)
438                                 clean=true
439                                 shift
440                                 ;;
441                         *)
442                                 clean=false
443                                 ;;
444                 esac
445                 case "$1" in
446                         sdl)
447                                 TARGETS="sdl-debug"
448                                 shift
449                                 ;;
450                         glx|agl|wgl)
451                                 TARGETS="cl-debug"
452                                 shift
453                                 ;;
454                         dedicated)
455                                 TARGETS="sv-debug"
456                                 shift
457                                 ;;
458                 esac
459                 if [ -z "$MAKEFLAGS" ]; then
460                         if [ -f /proc/cpuinfo ]; then
461                                 ncpus=$((`grep -c '^processor   :' /proc/cpuinfo`+0))
462                                 if [ $ncpus -gt 1 ]; then
463                                         MAKEFLAGS=-j$ncpus
464                                 fi
465                         fi
466                         case "`uname`" in
467                                 Linux|*BSD)
468                                         MAKEFLAGS="$MAKEFLAGS DP_LINK_TO_LIBJPEG=1"
469                                         ;;
470                         esac
471                         if [ -n "$WE_HATE_OUR_USERS" ]; then
472                                 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw"
473                         fi
474                 fi
475                 enter "$d0/fteqcc" verbose
476                 if $clean; then
477                         verbose make $MAKEFLAGS clean
478                 fi
479                 verbose make $MAKEFLAGS
480                 enter "$d0/data/xonotic-data.pk3dir" verbose
481                 if $clean; then
482                         verbose make $MAKEFLAGS clean
483                 fi
484                 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
485                 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
486                 enter "$d0/darkplaces" verbose
487                 if $clean; then
488                         verbose make $MAKEFLAGS clean
489                 fi
490                 for T in $TARGETS; do
491                         verbose make $MAKEFLAGS "$@" "$T"
492                 done
493                 ;;
494         run)
495                 if [ -n "$WE_HATE_OUR_USERS" ]; then
496                         client=
497                         export PATH="$d0/misc/buildfiles/w32:$PATH"
498                 elif [ x"`uname`" = x"Darwin" ]; then
499                         export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Nexuiz.app/Contents/MacOS"
500                         client=-sdl
501                 else
502                         client=-sdl
503                 fi
504                 case "$1" in
505                         sdl|glx|agl|dedicated)
506                                 client=-$1
507                                 shift
508                                 ;;
509                         wgl)
510                                 client=
511                                 shift
512                                 ;;
513                 esac
514                 if ! [ -x "darkplaces/darkplaces$client" ]; then
515                         if [ -x "darkplaces/darkplaces$client.exe" ]; then
516                                 client=$client.exe
517                         else
518                                 echo "Client darkplaces/darkplaces$client not found, aborting"
519                                 exit 1
520                         fi
521                 fi
522                 set -- "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic "$@"
523
524                 # if pulseaudio is running: USE IT
525                 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ]; then
526                         if ps -C pulseaudio >/dev/null; then
527                                 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
528                                         export SDL_AUDIODRIVER=pulse
529                                 fi
530                         fi
531                 fi
532
533                 if [ -n "$USE_GDB" ]; then
534                         set -- gdb --args "$@"
535                 fi
536                 "$@"
537                 ;;
538         each|foreach)
539                 for d in $repos; do
540                         if verbose cd "$d0/$d"; then
541                                 verbose "$@"
542                                 cd "$d0"
543                         fi
544                 done
545                 ;;
546         save-patches)
547                 outfile=$1
548                 patchdir=`mktemp -d -t save-patches.XXXXXX`
549                 for d in $repos; do
550                         enter "$d0/$d" verbose
551                         git branch -v -v | cut -c 3- | {
552                                 i=0
553                                 while read -r BRANCH REV UPSTREAM TEXT; do
554                                         case "$UPSTREAM" in
555                                                 \[*)
556                                                         UPSTREAM=${UPSTREAM#\[}
557                                                         UPSTREAM=${UPSTREAM%\]}
558                                                         UPSTREAM=${UPSTREAM%:*}
559                                                         TRACK=true
560                                                         ;;
561                                                 *)
562                                                         UPSTREAM=origin/"`repobranch "$d"`"
563                                                         TRACK=false
564                                                         ;;
565                                         esac
566                                         if [ x"$REV" = x"->" ]; then
567                                                 continue
568                                         fi
569                                         if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then
570                                                 echo "$d" > "$patchdir/$i/info.txt"
571                                                 echo "$BRANCH" >> "$patchdir/$i/info.txt"
572                                                 echo "$UPSTREAM" >> "$patchdir/$i/info.txt"
573                                                 echo "$TRACK" >> "$patchdir/$i/info.txt"
574                                                 i=$(($i+1))
575                                         else
576                                                 rm -rf "$patchdir/$i"
577                                         fi
578                                 done
579                         }
580                 done
581                 ( cd "$patchdir" && tar cvzf - . ) > "$outfile"
582                 rm -rf "$patchdir"
583                 ;;
584         restore-patches)
585                 infile=$1
586                 patchdir=`mktemp -d -t restore-patches.XXXXXX`
587                 ( cd "$patchdir" && tar xvzf - ) < "$infile"
588                 # detach the head
589                 for P in "$patchdir"/*/info.txt; do
590                         D=${P%/info.txt}
591                         exec 3<"$P"
592                         read -r d <&3
593                         read -r BRANCH <&3
594                         read -r UPSTREAM <&3
595                         read -r TRACK <&3
596                         verbose git checkout HEAD^0
597                         verbose git branch -D "$BRANCH"
598                         if [ x"$TRACK" = x"true" ]; then
599                                 verbose git checkout --track -b "$BRANCH" "$UPSTREAM"
600                         else
601                                 verbose git branch -b "$BRANCH" "$UPSTREAM"
602                         fi
603                         verbose git am "$D"
604                 done
605                 rm -rf "$patchdir"
606                 ;;
607         admin-merge)
608                 if [ "$#" = 1 ]; then
609                         set -- "${1%%/*}" "${1#*/}"
610                 fi
611                 for d in $repos; do
612                         enter "$d0/$d" verbose
613                         git rev-parse "$1/$2" || continue
614                         # 1. review
615                         {
616                                 git log HEAD.."$1/$2"
617                                 git diff HEAD..."$1/$2"
618                         } | less
619                         if yesno "Merge \"$1/$2\" into `git symbolic-ref HEAD` of $d?"; then
620                                 git merge "$1/$2"
621                                 if "$SELF" compile && yesno "Still merge \"$1/$2\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
622                                         git push origin HEAD
623                                         git push "$1" :"$2"
624                                 else
625                                         git reset --hard HEAD@{1}
626                                 fi
627                         fi
628                 done
629                 ;;
630         admin-merge-2)
631                 t=`mktemp`
632                 report=""
633                 reportecho()
634                 {
635                         report=$report"$*$LF"
636                         echo "$*"
637                 }
638                 reportecho4()
639                 {
640                         report=$report"    $*$LF"
641                         echo "    $*"
642                 }
643                 reportdo4()
644                 {
645                         o=`"$@" | sed 's/^/    /' || true`
646                         reportecho "$o"
647                 }
648                 for d in $repos; do
649                         enter "$d0/$d" verbose
650                         reportecho "In $d:"
651                         for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
652                                 case "${ref#refs/remotes/origin/}" in
653                                         "`repobranch "$d"`")
654                                                 continue
655                                                 ;;
656                                         HEAD|master)
657                                                 continue
658                                                 ;;
659                                 esac
660                                 reportecho "  Branch $ref:"
661                                 note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
662                                 if [ -n "$note" ]; then
663                                         reportdo4 echo "$note"
664                                         reportecho4 "--> not merging, already had this one rejected before"
665                                 elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ git log --color HEAD.."$ref"; git diff --color --find-copies-harder --ignore-space-change HEAD..."$ref"; } | less -r'; then
666                                         git checkout master
667                                         org=`git rev-parse HEAD`
668                                         if ! git merge "$ref" 2>&1 | tee "$t"; then
669                                                 git reset --hard "$org"
670                                                 git notes --ref "refs/notes/admin-merge" add -m "Merge failed:$LF`cat "$t"`" "$ref"
671                                                 reportdo4 cat "$t"
672                                                 reportecho4 "--> merge failed"
673                                         elif ! "$SELF" compile 2>&1 | tee "$t"; then
674                                                 git reset --hard "$org"
675                                                 git notes --ref "refs/notes/admin-merge" add -m "Compile failed:$LF`cat "$t"`" "$ref"
676                                                 reportdo4 cat "$t"
677                                                 reportecho4 "--> compile failed"
678                                         elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
679                                                 git reset --hard "$org"
680                                                 git notes --ref "refs/notes/admin-merge" add "$ref"
681                                                 note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
682                                                 reportdo4 echo "$note"
683                                                 reportecho4 "--> test failed"
684                                         else
685                                                 case ",`repoflags "$d"`," in
686                                                         *,svn,*)
687                                                                 git pull
688                                                                 git rebase -i "$org"
689                                                                 git svn dcommit --add-author-from
690                                                                 ;;
691                                                         *)
692                                                                 git push origin HEAD
693                                                                 ;;
694                                                 esac
695                                                 reportecho4 "--> MERGED"
696                                                 if yesno "Delete original branch \"$ref\"?"; then
697                                                         git push origin :"${ref#refs/remotes/origin/}"
698                                                         reportecho4 "--> branch deleted"
699                                                 fi
700                                         fi
701                                 else
702                                         git notes --ref "refs/notes/admin-merge" add "$ref"
703                                         note=`git notes --ref "refs/notes/admin-merge" show "$ref" 2>/dev/null || true`
704                                         if [ -n "$note" ]; then
705                                                 reportdo4 echo "$note"
706                                                 reportecho4 "--> rejected"
707                                         else
708                                                 reportecho4 "--> postponed"
709                                         fi
710                                 fi
711                                 reportecho ""
712                         done
713                         reportecho ""
714                 done
715                 rm -f "$t"
716                 echo "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
717                 ;;
718         *)
719                 echo "Usage:"
720                 echo "  $SELF pull"
721                 echo "  $SELF merge"
722                 echo "  $SELF push [-s]"
723                 echo "  $SELF branches"
724                 echo "  $SELF branch [<remote>] <branchname>"
725                 echo "  $SELF branch <remote> <branchname> <srcbranchname>"
726                 echo "  $SELF checkout [<remote>] <branchname>"
727                 echo "  $SELF compile [-c] [<client>] <options>"
728                 echo "  $SELF run [<client>] <options>"
729                 echo "  $SELF each <command>"
730                 ;;
731 esac