Most modern version control tools have a command to find the change that introduced the error when binary searching (dividing in half) the story. Such a command may be inlined or may be provided as an extension or plugin. Examples include git-bisect in Git, hg bisect "in Mercurial (formerly available as hbisect ), and the bzr-bisect plugin for Bazaar.
The challenge is to do this in an automatic or semi-automatic way, even in the presence of a non-linear history (branch points and merges). The goal is to find a “bad” revision in as few steps as possible, or in more detail, to find a commit for verification that, if possible, divides the commit graph into a test (DAG commits) in half. This problem is being solved, I think, very well.
But there is a problem with untestable commits , for example. if for some code the revision does not even compile, or if it compiles, it does not start / starts (or does not detect an error that is not related to the one you are looking for). This means that instead of just marking the commit as “good” or “bad,” you now have three possible states:
- good - no error
- bad - error behavior
- untestable - it is not known whether an error is present.
Some version control systems (SCMs) allow you to skip commits, usually moving to the parent version, such as the ones you need to check next.
Questions:
If you are faced with this situation, that is, you used halving and came across unverifiable versions, what in your experience distributes such unverifiable commits? Do they occur in isolation (one unverifiable commit), or do they appear in ranges (versions a..b are not subject to testing)? Are you in a situation where you had to skip commit after commit?
Is there some kind of mathematical model (for example, for simple deaeration of a list / linear history and even for halving an arbitrary DAG of revisions) or an algorithm (possibly heuristic) that allows optimizing the omissions of unverified commits. The goal is to reduce again (on average) the number of versions to testing if there are unverified commits (or an unrelated error).
Do you use a version control system or some add-on / extension / plugin for a version control system or any third-party tool that implements such an algorithm, in addition to allowing you to simply skip unverified commits, editing neighbors? What is this VCS or tool? What algorithm does it use (if you know it)?
Hope this leads to even easier (semi) automatic error searches ...
Added 06-06-2009:
When using advanced Git functions, there is one situation where you can have a whole branch of unchecked commits (or at least difficult to verify), namely, when you use the "subtree" merge to combine the histories of two separate projects (for example, the full Linux kernel with some drivers, it is developed separately using the “subtree" merge. This should be taken into account when developing an algorithm for processing unverified commits: with a nonlinear history, there may be a whole branch of unverified commits, and the algorithm should consider topology (several).