X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fdashtopatch;h=3661ccf66426c6fcbfae8166d405995f831596d3;hp=fb3d4fd4c0b41b20c5e8d8d36b69a8b5aeda1881;hb=575d057c2c709a4ac4743380ea5223ab48a2e147;hpb=4243605851773a10d2db6ef4c0b8f228d4e24c07 diff --git a/bin/dashtopatch b/bin/dashtopatch index fb3d4fd..3661ccf 100755 --- a/bin/dashtopatch +++ b/bin/dashtopatch @@ -1,14 +1,5 @@ #! /bin/sh set -ex -if [ "$1" = "-f" ];then - force=true - shift -elif [ -n "$(/bin/ls *.patch 2>/dev/null|tee /proc/self/fd/2)" ];then - echo >&2 "Some *.patch files exist!" - exit 1 -else - force=false -fi if [ $# != 1 ] || ! echo "$1" | grep -q '-';then echo >&2 "Syntax: $0 branch-list-delimited-by-dashes" exit 1 @@ -22,13 +13,10 @@ for elem in $(echo "$1"|tr '-' ' ');do fi git checkout "$next" git merge "$base" - if $force;then + if [ -e "$next".patch ];then echo -e '/^--- /,$d\nw'|ed "$next".patch - else - rm -f "$next".patch fi git diff "$base" "$next"|diffdecvs >>"$next".patch base="$next" done -git checkout master echo OK