From 9654d9375035f42eee1b5eda8ed0d0e780fc301b Mon Sep 17 00:00:00 2001 From: jkratoch <> Date: Sun, 8 Aug 2010 22:41:32 +0000 Subject: [PATCH] +gerrit support do not stop on fully merged stages --- bin/dashtopatch | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bin/dashtopatch b/bin/dashtopatch index 3661ccf..03ae652 100755 --- a/bin/dashtopatch +++ b/bin/dashtopatch @@ -5,6 +5,13 @@ if [ $# != 1 ] || ! echo "$1" | grep -q '-';then 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" @@ -14,9 +21,18 @@ for elem in $(echo "$1"|tr '-' ' ');do 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 -- 1.8.3.1