exit 1
fi
base="master"
+gerrit=true
+if git branch -D gerrit;then
+ git checkout master
+ git checkout -b gerrit
+else
+ gerrit=false
+fi
for elem in $(echo "$1"|tr '-' ' ');do
if [ "$base" = "master" ];then
next="$elem"
git checkout "$next"
git merge "$base"
if [ -e "$next".patch ];then
- echo -e '/^--- /,$d\nw'|ed "$next".patch
+ echo -e '/^--- /,$d\nw'|ed "$next".patch || :
fi
git diff "$base" "$next"|diffdecvs >>"$next".patch
+ if $gerrit;then
+ cp "$next".patch dashtopatch.patch
+ echo -e '/^--- /,$d\nw'|ed dashtopatch.patch
+ git checkout gerrit
+ patch -p1 <"$next".patch
+ git commit -a -F dashtopatch.patch
+ rm -f dashtopatch.patch
+ fi
base="$next"
done
+git checkout "$next"
echo OK