From: jkratoch <> Date: Mon, 26 Jul 2010 19:39:32 +0000 (+0000) Subject: init X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=4243605851773a10d2db6ef4c0b8f228d4e24c07 init --- diff --git a/bin/dashtopatch b/bin/dashtopatch new file mode 100755 index 0000000..fb3d4fd --- /dev/null +++ b/bin/dashtopatch @@ -0,0 +1,34 @@ +#! /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 +fi +base="master" +for elem in $(echo "$1"|tr '-' ' ');do + if [ "$base" = "master" ];then + next="$elem" + else + next="$base-$elem" + fi + git checkout "$next" + git merge "$base" + if $force;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