@matheusbsbs / matheus-bagliano / commits / 9d79b7e95d
Fork 0

git-bisect.txt: streamline run presentation

Streamline the presentation of "bisect run" by removing one example which does not introduce new concepts. 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 9d79b7e95d9acf07ff1479f41faa860503ce280e
1 file changed +8 -26
Documentation/git-bisect.txt
+8 -26
@@ -274,53 +274,35 @@ $ git bisect start HEAD origin -- # HEAD is bad, origin is good
274 $ git bisect run make test # "make test" builds and tests
275 ------------
276
277 -* Automatically bisect a broken test suite:
278 -+
279 -------------
280 -$ cat ~/test.sh
281 -#!/bin/sh
282 -make || exit 125 # this skips broken builds
283 -make test # "make test" runs the test suite
284 -$ git bisect start v1.3 v1.1 -- # v1.3 is bad, v1.1 is good
285 -$ git bisect run ~/test.sh
286 -------------
287 -+
288 -Here we use a "test.sh" custom script. In this script, if "make"
289 -fails, we skip the current commit.
290 -+
291 -It is safer to use a custom script outside the repository to prevent
292 -interactions between the bisect, make and test processes and the
293 -script.
294 -+
295 -"make test" should "exit 0", if the test suite passes, and
296 -"exit 1" otherwise.
297 -
277 * Automatically bisect a broken test case:
278 +
279 ------------
280 $ cat ~/test.sh
281 #!/bin/sh
282 make || exit 125 # this skips broken builds
304 -~/check_test_case.sh # does the test case passes ?
283 +~/check_test_case.sh # does the test case pass?
284 $ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
285 $ git bisect run ~/test.sh
286 ------------
287 +
309 -Here "check_test_case.sh" should "exit 0" if the test case passes,
288 +Here we use a "test.sh" custom script. In this script, if "make"
289 +fails, we skip the current commit.
290 +"check_test_case.sh" should "exit 0" if the test case passes,
291 and "exit 1" otherwise.
292 +
312 -It is safer if both "test.sh" and "check_test_case.sh" scripts are
293 +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
316 -* Automatically bisect a broken test suite:
297 +* Automatically bisect a broken test case:
298 +
299 ------------
300 $ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
301 $ git bisect run sh -c "make || exit 125; ~/check_test_case.sh"
302 ------------
303 +
323 -Does the same as the previous example, but on a single line.
304 +This shows that you can do without a run script if you write the test
305 +on a single line.
306
307 Author
308 ------