git/bisect.sh: add simple script for running bisect

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-06-26 21:51:04 +02:00
parent 1e1228cd3a
commit dc620816c1
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 18 additions and 0 deletions

18
git/bisect.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
GOOD="${1}"
BAD="${2}"
COMMAND="${3}"
REPEAT="${3:-1}"
[[ -z "${GOOD}" ]] && { echo "No bisect good commit provided!" >&2; exit 1; }
[[ -z "${BAD}" ]] && { echo "No bisect bad commit provided!" >&2; exit 1; }
[[ -z "${COMMAND}" ]] && { echo "No bisect command provided!" >&2; exit 1; }
git bisect start
git bisect good "${GOOD}"
git bisect bad "${BAD}"
git bisect run bash -c "${COMMAND}"
git bisect log
git bisect visualize --stat
git bisect reset