X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=all;h=a5e00520bb069eec4cc152ed89745cf0ce98e947;hp=c1a830f750343884c60982b16864fdbb3fa8bbd7;hb=ebd8334087189f3da26b77c689dc49d022e339ee;hpb=9c652378468e8b2dc7010764c7b6091a6f04ae0d diff --git a/all b/all index c1a830f7..a5e00520 100755 --- a/all +++ b/all @@ -1,4 +1,5 @@ #!/bin/sh +# vim: filetype=zsh set -e @@ -153,7 +154,11 @@ case "$cmd" in fi ;; esac - verbose git config remote.origin.fetch "refs/heads/*:refs/remotes/origin/*" + verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + # TODO remove this line later + + verbose git config core.autocrlf input + verbose git config core.safecrlf true r=`git symbolic-ref HEAD` r=${r#refs/heads/} @@ -292,6 +297,7 @@ case "$cmd" in done ;; push|commit) + submit=$1 for d in $repos; do dv=`visible_repo_name "$d"` enter "$d0/$d" verbose @@ -308,16 +314,24 @@ case "$cmd" in verbose git commit -a fi fi - if git log "origin/$r".."$r" | grep .; then + rem=`git config "branch.$r.remote" || echo origin` + if git log "$rem/$r".."$r" | grep .; then a= while [ x"$a" != x"y" -a x"$a" != x"n" ]; do echo "Push \"$r\" in $dv?" read -r a done if [ x"$a" = x"y" ]; then - verbose git push `git config "branch.$r.remote" || echo origin` HEAD + verbose git push "$rem" HEAD fi fi + if [ x"$submit" = x"-s" ]; then + case "$r" in + */*) + verbose git push "$rem" HEAD:"${r%%/*}/finished/${r#*/}" + ;; + esac + fi cd "$d0" done ;; @@ -392,9 +406,9 @@ case "$cmd" in if [ x"$REV" = x"->" ]; then continue fi - if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH" | grep .; then + if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then echo "$d" > "$patchdir/$i/info.txt" - echo "$BRANCH" > "$patchdir/$i/info.txt" + echo "$BRANCH" >> "$patchdir/$i/info.txt" echo "$UPSTREAM" >> "$patchdir/$i/info.txt" echo "$TRACK" >> "$patchdir/$i/info.txt" i=$(($i+1)) @@ -430,11 +444,35 @@ case "$cmd" in done rm -rf "$patchdir" ;; + admin-merge) + for d in $repos; do + enter "$d0/$d" verbose + git rev-parse "$1/$2" || continue + # 1. review + { + git log HEAD.."$1/$2" + git diff HEAD..."$1/$2" + } | less + a= + while [ x"$a" != x"y" -a x"$a" != x"n" ]; do + echo "Merge \"$1/$2\" into `git symbolic-ref HEAD` of $d?" + read -r a + done + if [ x"$a" = x"y" ]; then + git merge "$1/$2" + cd "$d0" + "$SELF" compile + cd "$d0/d" + git push origin HEAD + git push "$1" :"$2" + fi + done + ;; *) echo "Usage:" echo " $SELF pull" echo " $SELF merge" - echo " $SELF push" + echo " $SELF push [-s]" echo " $SELF branches" echo " $SELF branch [] " echo " $SELF branch "