git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv2 2/2] git-bisect.txt: example for bisecting with hot-fix

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 15, 2011, 21:24 UTC
Message-ID
<500d8098e1993b3aab3e1ff4f616ae9093cd2a1b.1300224056.git.git@drmicha.warpmail.net>
In-Reply-To
<7vy64hehbh.fsf@alter.siamese.dyndns.org>

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>
---
The example script is basically Junio's, with merge rather than cherry-pick.
 Documentation/git-bisect.txt |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 47e8b1e..989e223 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -294,6 +294,39 @@ It is safer if both "test.sh" and "check_test_case.sh" are
 outside the repository to prevent interactions between the bisect,
 make and test processes and the scripts.
 
+* Automatically bisect with temporary modifications (hot-fix):
++
+------------
+$ cat ~/test.sh
+#!/bin/sh
+
+# tweak the working tree by merging the hot-fix branch
+# and then attempt a build
+if	git merge --no-commit hot-fix &&
+	make
+then
+	# run project specific test and report its status
+	~/check_test_case.sh
+	status=$?
+else
+	# tell the caller this is untestable
+	status=125
+fi
+
+# undo the tweak to allow clean flipping to the next commit
+git reset --hard
+
+# return control
+exit $status
+------------
++
+This applies modifications from a hot-fix branch before each test run,
+e.g. in case your build or test environment changed so that older
+revisions may need a fix which newer ones have already. (Make sure the
+hot-fix branch is based off a commit which is contained in all revisions
+which you are bisecting, so that the merge does not pull in too much, or
+use `git cherry-pick` instead of `git merge`.)
+
 * Automatically bisect a broken test case:
 +
 ------------
-- 
1.7.4.1.404.g62d316
Previous: Michael J GruberNext: Ralf Wildenhues
Message 5 of 10 in “git bisect plus fixes (was: PATCH: Add --size-check=[error|warning])”
  1. Ralf WildenhuesMar 14, 2011
  2. git-bisect.txt: example for bisecting with hotfixMichael J Gruber, Mar 14, 2011
  3. Junio C HamanoMar 14, 2011
  4. 1/2 git-bisect.txt: streamline run presentationMichael J Gruber, Mar 15, 2011
  5. 2/2 git-bisect.txt: example for bisecting with hot-fixMichael J Gruber, Mar 15, 2011
  6. Document 'git bisect fix'.Ralf Wildenhues, Mar 14, 2011
  7. Yann DirsonMar 15, 2011
  8. Christian CouderMar 16, 2011
  9. Michael J GruberMar 16, 2011
  10. Junio C HamanoMar 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.