Add contrib/stg-mdiff: display diffs of diffs.
authorYann Dirson <ydirson@altern.org>
Fri, 2 Mar 2007 21:34:29 +0000 (21:34 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Fri, 2 Mar 2007 21:34:29 +0000 (21:34 +0000)
Signed-off-by: Yann Dirson <ydirson@altern.org>
contrib/stg-mdiff [new file with mode: 0755]

diff --git a/contrib/stg-mdiff b/contrib/stg-mdiff
new file mode 100755 (executable)
index 0000000..cd0c678
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -e
+
+# stg-mdiff - display meta-diffs, ie. diffs of diffs
+
+# Main use: show evolutions of a patch.
+# eg. stg-mdiff foo@stable foo
+#     stg-mdiff foo 012345567ABCD # sha1 for "foo" as integrated upstream
+
+# Copyright (c) 2007 Yann Dirson <ydirson@altern.org>
+# Subject to the GNU GPL, version 2.
+
+usage()
+{
+    echo "Usage: $(basename $0) <patch1> <patch2>"
+    exit 1
+}
+
+if [ "$#" != 2 ]; then
+    usage
+fi
+
+colordiff -u <(stg show "$1") <(stg show "$2") | less -RFX