6/28/2011 - Tim Elliott
I recently ran into Nokogiri issue #488 - version > 1.4.4 produces duplicate elements when using Nokogiri::HTML with an invalid HTML doc .
I was able to write a test that reproduced the issue and was curious if git can bisect it down to the commit that caused it. Here are my notes -- they might come in handy if you are trying to bisect another ruby library.
I am also looking for feedback on how the bisect cycle could be made more efficient.
$ git clone https://github.com/tenderlove/nokogiri.git
The test that I wrote in this case consists of an html file and a unit test , test/test_document2.rb.
$ git bisect reset $ git bisect start
As you can see from the bug report , the last known good version was v1.4.4.
$ git bisect good v1.4.4
$ rake clean; rake compile
$ ruby -Itest -Ilib test/html/test_document2.rb
This should obviously be "bad" on the first run.
$ git-bisect bad # or $ git-bisect good
If the bisection is able to infer which commit caused the bug, git will print out the details of the offending commit and you are done.
Otherwise, git will already have fetched the next version that needs to be tested into your working directory. In this case, go back to 5. Compile Nokogiri.