|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: git bisect |
| 4 | +date: 2015-03-16 |
| 5 | +author: Nicolas Sebrecht |
| 6 | +--- |
| 7 | + |
| 8 | +{% assign offlineimap = site.data.links.offlineimap %} |
| 9 | +{% assign icons = site.data.icons %} |
| 10 | + |
| 11 | +{: .note} |
| 12 | +There are already a lot of documentation about `git bisect`, already. Sadly, few explain HOW to do it properly when you're not used to development. |
| 13 | + |
| 14 | + |
| 15 | +* junk |
| 16 | +{:toc} |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Pre-requisite |
| 21 | + |
| 22 | +You'll need `git` and the git repository of OfflineIMAP, of course... ;-) |
| 23 | + |
| 24 | +Clone the repository: |
| 25 | + |
| 26 | +{% highlight bash %} |
| 27 | +$ git clone {{ offlineimap.repository }} |
| 28 | +{% endhighlight %} |
| 29 | + |
| 30 | +## The commands |
| 31 | + |
| 32 | +There are few simple commands to know. |
| 33 | + |
| 34 | +* Start a session |
| 35 | +{% highlight bash %} |
| 36 | +$ git bisect start |
| 37 | +{% endhighlight %} |
| 38 | + |
| 39 | +* Mark as good |
| 40 | +{% highlight bash %} |
| 41 | +$ git bisect good |
| 42 | +{% endhighlight %} |
| 43 | + |
| 44 | +* Mark as bad |
| 45 | +{% highlight bash %} |
| 46 | +$ git bisect bad |
| 47 | +{% endhighlight %} |
| 48 | + |
| 49 | +* Ignore a step |
| 50 | +{% highlight bash %} |
| 51 | +$ git bisect skip |
| 52 | +{% endhighlight %} |
| 53 | + |
| 54 | +* Stop a session |
| 55 | +{% highlight bash %} |
| 56 | +$ git bisect reset |
| 57 | +{% endhighlight %} |
| 58 | + |
| 59 | +## Effective session |
| 60 | + |
| 61 | +Before starting, you should know what version works and what version does not. This is required to start the process. |
| 62 | + |
| 63 | +{% highlight bash %} |
| 64 | +$ git bisect start |
| 65 | +$ git bisect good v6.5.6 |
| 66 | +$ git bisect bad v6.5.7-rc2 |
| 67 | +{% endhighlight %} |
| 68 | + |
| 69 | +From there, it's you're job to define if OfflineIMAP has the **same issue** or not. |
| 70 | + |
| 71 | +{% highlight bash %} |
| 72 | +$ ./offlineimap.py [THE USUAL OPTIONS] |
| 73 | +{% endhighlight %} |
| 74 | + |
| 75 | +{: .warning} |
| 76 | +{{ icons.warning }} Warning {{ icons.end }} |
| 77 | + Be care to mark the checkouted version as `good` or `bad` **ONLY** if you're sure about that. |
| 78 | + |
| 79 | + *A wrong declaration will put you in the wrong direction.* |
| 80 | + |
| 81 | +When in doubt, you must input the `git bisect skip` command. |
| 82 | + |
| 83 | +{: .warning} |
| 84 | +{{ icons.warning }} Warning {{ icons.end }} |
| 85 | +**A failing run does NOT necessary mean you should declare it `bad`.** |
| 86 | + |
| 87 | +In such case, you must check what's the error and if it's the one you are bisecting. Otherwise, you must input `git bisect skip` command, too. |
| 88 | + |
| 89 | +## Understanding what is done |
| 90 | + |
| 91 | +The process is fairly simple to understand. It just start in the middle of the patch series between the one marked as `good` and the one marked as `bad`. When a new `good`/`bad` is declared, it take the new middle between both and continue. |
| 92 | + |
| 93 | +{: .note} |
| 94 | +It's a bit more complex if the *git history* is not linear but we don't have to care about the internals. |
| 95 | + |
| 96 | +<!-- |
| 97 | +vim: expandtab ts=2 : |
| 98 | +--> |
0 commit comments