#!/bin/sh
+# vim: filetype=zsh
set -e
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
+
+ git config core.autocrlf input
+ git config core.safecrlf true
r=`git symbolic-ref HEAD`
r=${r#refs/heads/}
done
;;
push|commit)
+ submit=$1
for d in $repos; do
dv=`visible_repo_name "$d"`
enter "$d0/$d" verbose
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
;;
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))
echo "Usage:"
echo " $SELF pull"
echo " $SELF merge"
- echo " $SELF push"
+ echo " $SELF push [-s]"
echo " $SELF branches"
echo " $SELF branch [<remote>] <branchname>"
echo " $SELF branch <remote> <branchname> <srcbranchname>"