1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-02 09:21:40 +02:00
lazygit/scripts/bisect.sh

21 lines
884 B
Bash
Raw Normal View History

2022-01-17 09:29:30 +02:00
#!/bin/sh
# How to use:
# 1) find a commit that is working fine.
2022-08-11 13:17:01 +02:00
# 2) Create an integration test capturing the fact that it works (Don't commit it). See https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md
2022-01-17 09:29:30 +02:00
# 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
2022-01-19 00:04:16 +02:00
# usage: scripts/bisect.sh <ref that's broken> <ref that's working> <integration test name>
2022-01-17 09:29:30 +02:00
# e.g. scripts/bisect.sh v0.32.1 mergeConflictsResolvedExternally
# It's assumed that the current commit (i.e. HEAD) is broken.
2022-01-19 00:04:16 +02:00
if [[ $# -ne 3 ]] ; then
echo 'Usage: scripts/bisect.sh <ref thats broken> <ref thats working> <integration test name>'
exit 1
fi
2022-01-17 09:29:30 +02:00
2022-01-19 00:04:16 +02:00
git bisect start $1 $2
git bisect run sh -c "(go build -o /dev/null || exit 125) && go test ./pkg/gui -run /$3"
2022-01-17 09:29:30 +02:00
git bisect reset