|
62 | 62 | "source": [
|
63 | 63 | "%%bash\n",
|
64 | 64 | "rm -rf bisectdemo\n",
|
65 |
| - "git clone [email protected]:shawnsi/bisectdemo.git" |
| 65 | + "git clone [email protected]:UCL-RITS/bisectdemo.git" |
66 | 66 | ]
|
67 | 67 | },
|
68 | 68 | {
|
|
137 | 137 | "name": "stderr",
|
138 | 138 | "output_type": "stream",
|
139 | 139 | "text": [
|
140 |
| - "error: branch 'buggy' not found.\n", |
141 | 140 | "Switched to a new branch 'buggy'\n"
|
142 | 141 | ]
|
143 | 142 | }
|
144 | 143 | ],
|
145 | 144 | "source": [
|
146 |
| - "%%bash \n", |
| 145 | + "%%bash\n", |
147 | 146 | "./breakme.sh > break_output"
|
148 | 147 | ]
|
149 | 148 | },
|
|
165 | 164 | },
|
166 | 165 | "outputs": [
|
167 | 166 | {
|
168 |
| - "ename": "SyntaxError", |
169 |
| - "evalue": "invalid syntax (<ipython-input-6-69f578907137>, line 1)", |
170 |
| - "output_type": "error", |
171 |
| - "traceback": [ |
172 |
| - "\u001b[0;36m File \u001b[0;32m\"<ipython-input-6-69f578907137>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m python squares.py 2 # Error message\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" |
| 167 | + "name": "stderr", |
| 168 | + "output_type": "stream", |
| 169 | + "text": [ |
| 170 | + "Traceback (most recent call last):\n", |
| 171 | + " File \"squares.py\", line 9, in <module>\n", |
| 172 | + " print(integer**2)\n", |
| 173 | + "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n" |
173 | 174 | ]
|
| 175 | + }, |
| 176 | + { |
| 177 | + "ename": "CalledProcessError", |
| 178 | + "evalue": "Command 'b'python squares.py 2 #\\xc2\\xa0Error message\\n'' returned non-zero exit status 1.", |
| 179 | + "output_type": "error" |
174 | 180 | }
|
175 | 181 | ],
|
176 | 182 | "source": [
|
| 183 | + "%%bash\n", |
177 | 184 | "python squares.py 2 # Error message"
|
178 | 185 | ]
|
179 | 186 | },
|
|
316 | 323 | "cell_type": "markdown",
|
317 | 324 | "metadata": {},
|
318 | 325 | "source": [
|
| 326 | + "Stop the bisect process with:\n", |
| 327 | + "\n", |
319 | 328 | "``` bash\n",
|
320 |
| - "git bisect end\n", |
| 329 | + "git bisect reset\n", |
321 | 330 | "```"
|
322 | 331 | ]
|
323 | 332 | },
|
|
327 | 336 | "source": [
|
328 | 337 | "### Solving automatically\n",
|
329 | 338 | "\n",
|
330 |
| - "If we have an appropriate unit test, we can do all this automatically:" |
| 339 | + "If we have an appropriate unit test, we can do all this automatically:\n", |
| 340 | + "\n", |
| 341 | + "(*NOTE*: You don't need [to redirect the `stderr` and `stdout`](https://linuxize.com/post/bash-redirect-stderr-stdout/) (with `&>`) of `git bisect run` to a file when running these commands outside a jupyter notebook (i.e., on a shell). This is done here so the errors appears with the right commits)" |
331 | 342 | ]
|
332 | 343 | },
|
333 | 344 | {
|
|
351 | 362 | "output_type": "stream",
|
352 | 363 | "text": [
|
353 | 364 | "Bisecting: 500 revisions left to test after this (roughly 9 steps)\n",
|
354 |
| - "[f85561dbe54b69fc7f037e3fd1b742b7395726b5] Comment 500\n", |
| 365 | + "[8ab337c43ca34bf91ab17cc55890be57d3567c82] Comment 500\n", |
355 | 366 | "running python squares.py 2\n",
|
356 | 367 | "4\n",
|
357 | 368 | "Bisecting: 250 revisions left to test after this (roughly 8 steps)\n",
|
358 |
| - "[1842ee96db81d26ce5c00a4b8750bd19ec380bfc] Comment 749\n", |
| 369 | + "[d25fb2ac5a0ed2e9474bec5a32e52eaf6f96ff6c] Comment 749\n", |
359 | 370 | "running python squares.py 2\n",
|
| 371 | + "Traceback (most recent call last):\n", |
| 372 | + " File \"squares.py\", line 9, in <module>\n", |
| 373 | + " print(integer**2)\n", |
| 374 | + "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
360 | 375 | "Bisecting: 124 revisions left to test after this (roughly 7 steps)\n",
|
361 |
| - "[749d1352b870cc169bc3c6e9e15c69d191a2a66e] Comment 625\n", |
| 376 | + "[cc0d01b552be8314dc9734c78b3363b620cb325c] Comment 624\n", |
362 | 377 | "running python squares.py 2\n",
|
363 |
| - "4\n", |
| 378 | + "Traceback (most recent call last):\n", |
| 379 | + " File \"squares.py\", line 9, in <module>\n", |
| 380 | + " print(integer**2)\n", |
| 381 | + "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
364 | 382 | "Bisecting: 62 revisions left to test after this (roughly 6 steps)\n",
|
365 |
| - "[150773712a2e9e8a371f33429abf9826d3a2b65e] Comment 687\n", |
| 383 | + "[4b46a6e37c388d260d61409e51864ae77ba19d6d] Comment 562\n", |
366 | 384 | "running python squares.py 2\n",
|
367 | 385 | "4\n",
|
368 | 386 | "Bisecting: 31 revisions left to test after this (roughly 5 steps)\n",
|
369 |
| - "[0e12bcd2d685904abf22431381000c68ca0af230] Comment 717\n", |
| 387 | + "[5eda263aaa5d0914b5871f546db26b7914895271] Breaking argument type\n", |
370 | 388 | "running python squares.py 2\n",
|
| 389 | + "Traceback (most recent call last):\n", |
| 390 | + " File \"squares.py\", line 9, in <module>\n", |
| 391 | + " print(integer**2)\n", |
| 392 | + "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
371 | 393 | "Bisecting: 15 revisions left to test after this (roughly 4 steps)\n",
|
372 |
| - "[cd59a9f75102f1b49863ad424fc35dc802522ccd] Comment 702\n", |
| 394 | + "[c9097be29af1b3437905feb0969669820ea81283] Comment 577\n", |
373 | 395 | "running python squares.py 2\n",
|
374 | 396 | "4\n",
|
375 | 397 | "Bisecting: 7 revisions left to test after this (roughly 3 steps)\n",
|
376 |
| - "[a105ae052d898733015676ac6709b1ffe88ed8bd] Comment 709\n", |
| 398 | + "[8021453f7f6fde4319a21337968832be1cc4151a] Comment 585\n", |
377 | 399 | "running python squares.py 2\n",
|
| 400 | + "4\n", |
378 | 401 | "Bisecting: 3 revisions left to test after this (roughly 2 steps)\n",
|
379 |
| - "[08508dd54091baa9e00c3599cb83cd0cda5b5837] Comment 706\n", |
| 402 | + "[f373b49b6545427ce00c991ca112bdc65d712fbf] Comment 589\n", |
380 | 403 | "running python squares.py 2\n",
|
381 | 404 | "4\n",
|
382 | 405 | "Bisecting: 1 revision left to test after this (roughly 1 step)\n",
|
383 |
| - "[7ced4763b6ab1600aab31d18fd2592186fd78b89] Comment 707\n", |
| 406 | + "[66f6530a9d0a459fc0ba132c17451d281449ffee] Comment 591\n", |
384 | 407 | "running python squares.py 2\n",
|
| 408 | + "4\n", |
385 | 409 | "Bisecting: 0 revisions left to test after this (roughly 0 steps)\n",
|
386 |
| - "[ebb3f4a5f4000c28bbc12d4d0187bbdad3d92241] Breaking argument type\n", |
| 410 | + "[1694ac7328d0a379362dec982d8d3afe14cc98b8] Comment 592\n", |
387 | 411 | "running python squares.py 2\n",
|
388 |
| - "ebb3f4a5f4000c28bbc12d4d0187bbdad3d92241 is the first bad commit\n", |
389 |
| - "commit ebb3f4a5f4000c28bbc12d4d0187bbdad3d92241\n", |
| 412 | + "4\n", |
| 413 | + "5eda263aaa5d0914b5871f546db26b7914895271 is the first bad commit\n", |
| 414 | + "commit 5eda263aaa5d0914b5871f546db26b7914895271\n", |
390 | 415 | "Author: Shawn Siefkas <[email protected]>\n",
|
391 | 416 | "Date: Thu Nov 14 09:23:55 2013 -0600\n",
|
392 | 417 | "\n",
|
393 | 418 | " Breaking argument type\n",
|
394 | 419 | "\n",
|
395 |
| - ":100644 100644 430222f37d6aad3ba2b7f235991473e680c7e4d8 03bc808166ca5cd0a8cca51cfb522e0724a31bc6 M\tsquares.py\n", |
| 420 | + " squares.py | 2 +-\n", |
| 421 | + " 1 file changed, 1 insertion(+), 1 deletion(-)\n", |
396 | 422 | "bisect run success\n"
|
397 | 423 | ]
|
398 | 424 | },
|
399 | 425 | {
|
400 | 426 | "name": "stderr",
|
401 | 427 | "output_type": "stream",
|
402 | 428 | "text": [
|
403 |
| - "Previous HEAD position was f85561d... Comment 500\n", |
404 |
| - "Switched to branch 'buggy'\n", |
405 |
| - "Traceback (most recent call last):\n", |
406 |
| - " File \"squares.py\", line 9, in <module>\n", |
407 |
| - " print(integer**2)\n", |
408 |
| - "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
409 |
| - "Traceback (most recent call last):\n", |
410 |
| - " File \"squares.py\", line 9, in <module>\n", |
411 |
| - " print(integer**2)\n", |
412 |
| - "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
413 |
| - "Traceback (most recent call last):\n", |
414 |
| - " File \"squares.py\", line 9, in <module>\n", |
415 |
| - " print(integer**2)\n", |
416 |
| - "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
417 |
| - "Traceback (most recent call last):\n", |
418 |
| - " File \"squares.py\", line 9, in <module>\n", |
419 |
| - " print(integer**2)\n", |
420 |
| - "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
421 |
| - "Traceback (most recent call last):\n", |
422 |
| - " File \"squares.py\", line 9, in <module>\n", |
423 |
| - " print(integer**2)\n", |
424 |
| - "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n" |
| 429 | + "Previous HEAD position was 1694ac7 Comment 592\n", |
| 430 | + "Switched to branch 'buggy'\n" |
425 | 431 | ]
|
426 | 432 | }
|
427 | 433 | ],
|
|
430 | 436 | "git bisect start\n",
|
431 | 437 | "git bisect bad HEAD # We know the current state is broken\n",
|
432 | 438 | "git bisect good master # We know master is good\n",
|
433 |
| - "git bisect run python squares.py 2" |
| 439 | + "git bisect run python squares.py 2 &> gitbisect.out\n", |
| 440 | + "cat gitbisect.out" |
434 | 441 | ]
|
435 | 442 | },
|
436 | 443 | {
|
|
0 commit comments