X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=bin%2Fdashtopatch;h=a70dff1e5753b5b060b8f846817ca59c39e86348;hb=1141e3ccd38cae6fffa7222f1623421b746519b7;hp=717c5cc275a632f398b5ca4b2d824af350310124;hpb=cfc106585f52a3b1124dbbad0026f705470113e6;p=nethome.git diff --git a/bin/dashtopatch b/bin/dashtopatch index 717c5cc..a70dff1 100755 --- a/bin/dashtopatch +++ b/bin/dashtopatch @@ -5,14 +5,14 @@ if [ "$1" = -c ];then compile=true shift fi -if [ $# != 1 ] || ! echo "$1" | grep -q '-';then +if [ $# != 1 ];then echo >&2 "Syntax: $0 branch-list-delimited-by-dashes" exit 1 fi if [ -f origin ];then origin="`cat origin`" else - origin="gdb/master" + origin="origin/master" fi base=$origin gerrit=true @@ -33,10 +33,13 @@ for elem in $(echo "$1"|tr '-' ' ');do if $compile;then make fi - if [ -e "$next".patch ];then - echo -e '/^--- /,$d\nw'|ed "$next".patch || : + if [ "$origin" != "master" ];then + if [ -e "$next".patch ];then + echo -e '/^--- /,$d\nw'|ed "$next".patch || : + fi + git diff "$base" "$next" --|diffdecvs >>"$next".patch + git diff -U9999999 --binary "$base" "$next" -- >"$next".Upatch fi - git diff "$base" "$next"|diffdecvs >>"$next".patch if $gerrit;then cp "$next".patch dashtopatch.patch echo -e '/^--- /,$d\nw'|ed dashtopatch.patch