summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-17 18:29:30 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-17 19:14:59 +1100
commit8ca71eeb362aebbb8b148f0ef2fc58d33fc05ee0 (patch)
treef3d4c73a1a4ce15ee248c073f76dd43d10aa7e91 /scripts
parentd3a3c8d87d5a25fe30ea5da76c572fad895bdfdb (diff)
add git bisect run script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bisect.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/bisect.sh b/scripts/bisect.sh
new file mode 100755
index 000000000..9742e9c80
--- /dev/null
+++ b/scripts/bisect.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# How to use:
+# 1) find a commit that is working fine.
+# 2) Create an integration test capturing the fact that it works (Don't commit it). See https://github.com/jesseduffield/lazygit/blob/master/docs/Integration_Tests.md
+# 3) checkout the commit that's known to be failing
+# 4) run this script supplying the commit sha / tag name that works and the name of the newly created test
+
+# usage: scripts/bisect.sh <ref that works> <integration test name>
+# e.g. scripts/bisect.sh v0.32.1 mergeConflictsResolvedExternally
+# It's assumed that the current commit (i.e. HEAD) is broken.
+
+set -o pipefail
+
+echo $1
+echo $2
+
+git bisect start HEAD $1
+git bisect run go test ./pkg/gui -run /$2
+git bisect reset