DEV Community

loading...

Discussion on: Track Down Pesky Bugs with `git bisect`

Collapse
thawkin3 profile image
Tyler Hawkins Author

Neat! Thanks for sharing.

It seems like if you're using a continuous integration model though where your tests are always running on each commit, and it's required that your tests pass before you're allowed to merge your new code into the master branch, you wouldn't end up in a situation in which you have failing tests on your master branch. Right?

So is automating git bisect assuming that you're not enforcing 100% passing tests? Or would you run it on your own branch in which you have multiple commits that haven't had their tests validated and you've introduced a bug somewhere in there, but you still haven't merged to master yet? Or what's the use case here?

Collapse
joeattardi profile image
Joe Attardi

That's a good point.

I think the use case would be if you uncover a bug that you don't have an automated test for, but you can then write one that reproduces the bug. Then you run git bisect in automatic mode. Once the issue is fixed, you can add that new test to your test suite. 🤷‍♂️That's the best one I can think of.