git-bisect.txt: example for bisecting with hot-fix
Give an example on how to bisect when older revisions need a hot-fix to build, run or test. Triggered by the binutils/kernel issue at http://thread.gmane.org/gmane.comp.gnu.binutils/52601/focus=1112779 Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Mar 15, 2011 at 22:24 UTC
e235b9168d8df2bc00ca2c77703ce1a98935c906
1 file changed
+33
Documentation/git-bisect.txt
+33
@@ -294,6 +294,39 @@ It is safer if both "test.sh" and "check_test_case.sh" are
294
outside the repository to prevent interactions between the bisect,
295
make and test processes and the scripts.
296
297
+* Automatically bisect with temporary modifications (hot-fix):
298
++
299
+------------
300
+$ cat ~/test.sh
301
+#!/bin/sh
302
+
303
+# tweak the working tree by merging the hot-fix branch
304
+# and then attempt a build
305
+if git merge --no-commit hot-fix &&
306
+ make
307
+then
308
+ # run project specific test and report its status
309
+ ~/check_test_case.sh
310
+ status=$?
311
+else
312
+ # tell the caller this is untestable
313
+ status=125
314
+fi
315
+
316
+# undo the tweak to allow clean flipping to the next commit
317
+git reset --hard
318
+
319
+# return control
320
+exit $status
321
+------------
322
++
323
+This applies modifications from a hot-fix branch before each test run,
324
+e.g. in case your build or test environment changed so that older
325
+revisions may need a fix which newer ones have already. (Make sure the
326
+hot-fix branch is based off a commit which is contained in all revisions
327
+which you are bisecting, so that the merge does not pull in too much, or
328
+use `git cherry-pick` instead of `git merge`.)
329
+
330
* Automatically bisect a broken test case:
331
+
332
------------