I'm working on a project with a team where we check in early and often. Individual checkins are completed to the satisfaction of the developer doing the change (including tests where possible) but sometimes the direction of work changes slightly and previous commits need to be reverted and done another way. Or, stub code is filled out in later commits.
When it comes time for code review, there's a sequence of commits all tagged with the same bug tracking id number. It's easy to get a list of such changes. When a reviewer looks through the changes one by one, sometimes there will be a commit A that is undone or modified by a later commit B as part of the same review. This can make reviewing more difficult.
If only one developer was working on the file for the duration of the change, then it's easy to do a diff between the original state of the file and the final state of the file. The problem arises when another developer happens to have made unrelated changes in the same file, or even in the same functions.
How do you handle this situation? Are there tools that, given a sequence of patches to a file, can give the moral equivalent of a diff between the first and last versions, but only including a subset of those patches?
Come to think of it, I could create a temporary branch in git starting from before the first related change, and cherry-pick the changes relevant to the review. Hopefully there won't be too many conflicts that need to be resolved (and if there are, then the whole lot should be reviewed at once anyway). Any other ideas?
More info: This happens to be a big legacy system where a single change might touch multiple files. The files are big and crufty - too big to just review the final product without an indication of what might have changed.