I've had to do a lot of this lately, and the most efficient attempts take on a certain pattern.
So you have a bug, and you can readily reproduce it. Also, the bug appeared in the last pull you made from Linus's tree. Perfect.
At this point you know that 'master' has the bug and that 'ORIG_HEAD' lacks the bug. You could just blindly bisect the whole thing, but you can save yourself some time (and also learn a bit about the nature of the bug) by using some clues and some quick tests to narrow things down a lot from the beginning.
This determination can be easy. Your goal is to first find a spot which you think works. You'd like it to be something a bit further than ORIG_HEAD, as you're trying to narrow things down.
The easy case is some driver breaks or similar, or you see some error message and it's clear what subsystem that came from. Take that information and use it to scan over the changesets you got from your pull:
gitk ORIG_HEAD..Note that when you select a changeset in gitk, the SHA ID of that commit becomes the current X selection. You can use that to do things more quickly below.
So you're found a sequence of commits that look suspicious. Pick the changeset before the first commit in the suspicious set, and check out a test tree with it as the tip into a test branch:
git checkout -b test $(SHA_ID)Build that kernel, and make sure the bug doesn't happen. Let's assume that this kernel passes your test. You have a few options on how to proceed.
The easiest thing to do is to just bisect using the information you now have:
git bisect start git bisect bad master git bisect good testand so on. Build, test boot, and if it shows the bug:
git bisect badelse if it succeeds:
git bisect goodand repeat the process until GIT shows you the guilty commit.
The other option is to try and figure out an approximate more optimal end point for bisection. Take the set of "suspicious" changeset your determined above, and take the one after the last and go:
git checkout -b test2 $(SHA_ID)If this shows the bug, you're in business:
git bisect start git bisect bad test2 git bisect good testand continue as detailed above.
When you're done with all of this:
git bisect resetand report your results to the mailing list.