Skip to content

Instantly share code, notes, and snippets.

@progers
Created August 5, 2022 12:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save progers/998452a15180ae369fee338bb39363fd to your computer and use it in GitHub Desktop.
Save progers/998452a15180ae369fee338bb39363fd to your computer and use it in GitHub Desktop.
Git bisect script for running a new test that has been stashed
bisect-stash-build-run.sh
----------8<----------
#!/bin/bash
git stash apply || exit 125
# build the test
# for a chromium/blink unittest, this is:
# ( echo n | gclient sync ) || exit 125
# autoninja -C out/Debug blink_unittests || exit 125
# run the test
# for a chromium/blink, this is:
# out/Debug/blink_unittests --gtest_filter=...
rv=$?
git reset --hard HEAD
exit $rv
----------8<----------
To use, add your new test and then stash it with "git stash".
Then, use git bisect:
git bisect start
git bisect good <revision>
git bisect bad <revision>
git bisect run bisect-stash-build-run.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment