dashtopatch: +support file "origin"
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 31 Jul 2013 15:39:45 +0000 (17:39 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 31 Jul 2013 15:39:45 +0000 (17:39 +0200)
bin/dashtopatch

index 73952a0..717c5cc 100755 (executable)
@@ -9,16 +9,21 @@ if [ $# != 1 ] || ! echo "$1" | grep -q '-';then
   echo >&2 "Syntax: $0 branch-list-delimited-by-dashes"
   exit 1
 fi
-base="gdb/master"
+if [ -f origin ];then
+  origin="`cat origin`"
+else
+  origin="gdb/master"
+fi
+base=$origin
 gerrit=true
 if git branch -D gerrit;then
-  git checkout gdb/master
+  git checkout $origin
   git checkout -b gerrit
 else
   gerrit=false
 fi
 for elem in $(echo "$1"|tr '-' ' ');do
-  if [ "$base" = "gdb/master" ];then
+  if [ "$base" = $origin ];then
     next="$elem"
   else
     next="$base-$elem"