Skip to content, Skip to search


Pinpoint regressions with Git

32 bytes added, 10:43, 22 March 2017
no edit summary
{{Development | git GitMenu}}
= How to bisect with Git =
== How to find which commit introduced a regression ==
So you found a regression? I.e. you know that the version worked perfectly that you had yesterday of, say, the [[Fiji LauncherImageJ Ops]]library, but today it crashes?
Git-bisect to the rescue!
This will start the bisection process, i.e. it will try to find a revision that is as much "in the middle" between the bad commit(s) and the good commit(s) (you will mark more and more commits as good or bad in the process, and by inference, the ancestors of good commits will be considered good, and the offspring of bad commits will be considered bad, too), and let you test that.
In our case, let's just test run the Fiji launcherunit tests:
<source lang="bash">
./ fiji && ./fijimvn clean test
If the test is undecided (for example, e.g.: it does not compile at all, so you do not know if the unit test in question passes), mark it with
<source lang="bash">
Note: instead of using a temporary tag, you can use the [[Git_reflogs|reflog]] of the HEAD ref ("<code>git cherry-pick HEAD@{1}"</code>), but if you are not familiar with the concept, tags are probably easier to handle.
= See also =
Bureaucrat, emailconfirmed, incoming, administrator, uploaders