tools: add bisect script
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Jul 2012 14:04:30 +0000 (16:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jul 2012 11:29:12 +0000 (13:29 +0200)
This script works like "git bisect" except that you can
specify with "bisect need ffmpeg|ffplay|ffserver|ffprobe" which tool(s)
are needed for testing a checkout

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tools/bisect [new file with mode: 0755]

diff --git a/tools/bisect b/tools/bisect
new file mode 100755 (executable)
index 0000000..de43f68
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    need)
+        case $2 in
+            ffmpeg|ffplay|ffprobe|ffserver)
+                echo $2.c >> need
+            ;;
+        esac
+    ;;
+    start|reset)
+        echo . > need
+        git bisect $*
+    ;;
+    skip)
+        git bisect $*
+    ;;
+    good|bad)
+        git bisect $*
+
+        until ls `cat need` > /dev/null 2> /dev/null; do
+            git bisect skip || break
+        done
+    ;;
+esac