aboutsummaryrefslogtreecommitdiff
blob: c45db6ef4cd2ac7126e378250bd691832607f5b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

if [ $# -ne 3 ] ; then
	echo "Usage: $0 <test script> <bad> <good> [... more opts to git bisect ...]"
	exit 1
fi

script=$1
shift
if [ ! -x "$script" ] ; then
	echo "Script is not executable: $script"
	exit 1
fi

set -e
cd "${0%/*}/.."

cp "$script" git-run-sandbox.sh
rm -f config.cache
make="make -s -j"
cat << EOF > git-run.sh
#!/bin/sh
./autogen.sh
./configure -q -C $(sandbox -V | tail -n1)
${make} clean
${make}
./src/sandbox.sh . ./data/sandbox.bashrc \; . ./git-run-sandbox.sh
EOF
chmod a+rx git-run.sh

git bisect start "$@"
exec git bisect run ./git-run.sh