Skip to content

Commit e235b91

Browse files
Michael J Grubergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9d79b7e commit e235b91

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Documentation/git-bisect.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,39 @@ It is safer if both "test.sh" and "check_test_case.sh" are
294294
outside the repository to prevent interactions between the bisect,
295295
make and test processes and the scripts.
296296

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+
297330
* Automatically bisect a broken test case:
298331
+
299332
------------

0 commit comments

Comments
 (0)