It's exactly what bisect does.
You can pass it a script to run and the script returns 0
or 1
for good or bad.
What else do you want bisect to do for you?
Simply read the doc:
Bisect run
If you have a script that can tell if the current source code is good or bad, you can bisect by issuing the command:
git bisect run my_script arguments
Note that the script (my_script in the above example) should exit with code 0 if the current source code is good/old, and exit with a code between 1
and 127
(inclusive), except 125
, if the current source code is bad/new.
Any other exit code will abort the bisect process.
The special exit code 125
should be used when the current source code cannot be tested. If the script exits with this code, the current revision will be skipped (see git bisect skip above).
125
was chosen as the highest sensible value to use for this purpose, because 126
and 127
are used by POSIX shells to signal specific error status (127
is for command not found, 126
is for command found but not executable—these details do not matter, as they are normal errors in the script, as far as bisect run is concerned).