module Bummr
  class Bisecter
    include Singleton

    def bisect
      puts "Bad commits found! Bisecting...".red

      system("bundle")
      system("git bisect start head master")

      Open3.popen2e("git bisect run #{TEST_COMMAND}") do |_std_in, std_out_err|
        while line = std_out_err.gets
          puts line

          sha_regex = Regexp::new("(.*) is the first bad commit\n").match(line)
          unless sha_regex.nil?
            sha = sha_regex[1]
          end

          if line == "bisect run success\n"
            Bummr::Rebaser.instance.remove_commit(sha)
          end
        end
      end
    end
  end
end

module Bummr
  class Bisecter
    include Singleton

    def bisect
      puts "Bad commits found! Bisecting...".red

      system("bundle")
      system("git bisect start")
      system("git bisect bad")
      system("git bisect good master")

      Open3.popen2e("git bisect run #{TEST_COMMAND}") do |_std_in, std_out_err|
        while line = std_out_err.gets
          puts line

          sha_regex = Regexp::new("(.*) is the first bad commit\n").match(line)
          unless sha_regex.nil?
            sha = sha_regex[1]
          end

          if line == "bisect run success\n"
            Bummr::Rebaser.instance.remove_commit(sha)
          end
        end
      end
    end
  end
end

Make bisect work with old git 1.9.1
Make bisect work with old git 1.9.1

I found that git version 1.9.1 under Debian wheezy does not like
combining the bad & good commands into the bisect start command like so;
git bisect start head master. It starts bisect correctly but it doesn't
set the bad & good points.
