Skip to content

Commit 9d79b7e

Browse files
Michael J Grubergitster
authored andcommitted
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>
1 parent 87b5054 commit 9d79b7e

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

Documentation/git-bisect.txt

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -274,53 +274,35 @@ $ git bisect start HEAD origin -- # HEAD is bad, origin is good
274274
$ git bisect run make test # "make test" builds and tests
275275
------------
276276

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-
298277
* Automatically bisect a broken test case:
299278
+
300279
------------
301280
$ cat ~/test.sh
302281
#!/bin/sh
303282
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?
305284
$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
306285
$ git bisect run ~/test.sh
307286
------------
308287
+
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,
310291
and "exit 1" otherwise.
311292
+
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
313294
outside the repository to prevent interactions between the bisect,
314295
make and test processes and the scripts.
315296

316-
* Automatically bisect a broken test suite:
297+
* Automatically bisect a broken test case:
317298
+
318299
------------
319300
$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
320301
$ git bisect run sh -c "make || exit 125; ~/check_test_case.sh"
321302
------------
322303
+
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.
324306

325307
Author
326308
------

0 commit comments

Comments
 (0)