|
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)", |
| 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" |
| 174 | + ] |
| 175 | + }, |
| 176 | + { |
| 177 | + "ename": "CalledProcessError", |
| 178 | + "evalue": "Command 'b'python squares.py 2 #\\xc2\\xa0Error message\\n'' returned non-zero exit status 1.", |
170 | 179 | "output_type": "error",
|
171 | 180 | "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" |
| 181 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 182 | + "\u001b[0;31mCalledProcessError\u001b[0m Traceback (most recent call last)", |
| 183 | + "\u001b[0;31mCalledProcessError\u001b[0m: Command 'b'python squares.py 2 #\\xc2\\xa0Error message\\n'' returned non-zero exit status 1." |
173 | 184 | ]
|
174 | 185 | }
|
175 | 186 | ],
|
176 | 187 | "source": [
|
| 188 | + "%%bash\n", |
177 | 189 | "python squares.py 2 # Error message"
|
178 | 190 | ]
|
179 | 191 | },
|
|
316 | 328 | "cell_type": "markdown",
|
317 | 329 | "metadata": {},
|
318 | 330 | "source": [
|
| 331 | + "Stop the bisect process with:\n", |
| 332 | + "\n", |
319 | 333 | "``` bash\n",
|
320 |
| - "git bisect end\n", |
| 334 | + "git bisect reset\n", |
321 | 335 | "```"
|
322 | 336 | ]
|
323 | 337 | },
|
|
327 | 341 | "source": [
|
328 | 342 | "### Solving automatically\n",
|
329 | 343 | "\n",
|
330 |
| - "If we have an appropriate unit test, we can do all this automatically:" |
| 344 | + "If we have an appropriate unit test, we can do all this automatically:\n", |
| 345 | + "\n", |
| 346 | + "(*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 | 347 | ]
|
332 | 348 | },
|
333 | 349 | {
|
|
351 | 367 | "output_type": "stream",
|
352 | 368 | "text": [
|
353 | 369 | "Bisecting: 500 revisions left to test after this (roughly 9 steps)\n",
|
354 |
| - "[f85561dbe54b69fc7f037e3fd1b742b7395726b5] Comment 500\n", |
| 370 | + "[8ab337c43ca34bf91ab17cc55890be57d3567c82] Comment 500\n", |
355 | 371 | "running python squares.py 2\n",
|
356 | 372 | "4\n",
|
357 | 373 | "Bisecting: 250 revisions left to test after this (roughly 8 steps)\n",
|
358 |
| - "[1842ee96db81d26ce5c00a4b8750bd19ec380bfc] Comment 749\n", |
| 374 | + "[d25fb2ac5a0ed2e9474bec5a32e52eaf6f96ff6c] Comment 749\n", |
359 | 375 | "running python squares.py 2\n",
|
| 376 | + "Traceback (most recent call last):\n", |
| 377 | + " File \"squares.py\", line 9, in <module>\n", |
| 378 | + " print(integer**2)\n", |
| 379 | + "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
360 | 380 | "Bisecting: 124 revisions left to test after this (roughly 7 steps)\n",
|
361 |
| - "[749d1352b870cc169bc3c6e9e15c69d191a2a66e] Comment 625\n", |
| 381 | + "[cc0d01b552be8314dc9734c78b3363b620cb325c] Comment 624\n", |
362 | 382 | "running python squares.py 2\n",
|
363 |
| - "4\n", |
| 383 | + "Traceback (most recent call last):\n", |
| 384 | + " File \"squares.py\", line 9, in <module>\n", |
| 385 | + " print(integer**2)\n", |
| 386 | + "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
364 | 387 | "Bisecting: 62 revisions left to test after this (roughly 6 steps)\n",
|
365 |
| - "[150773712a2e9e8a371f33429abf9826d3a2b65e] Comment 687\n", |
| 388 | + "[4b46a6e37c388d260d61409e51864ae77ba19d6d] Comment 562\n", |
366 | 389 | "running python squares.py 2\n",
|
367 | 390 | "4\n",
|
368 | 391 | "Bisecting: 31 revisions left to test after this (roughly 5 steps)\n",
|
369 |
| - "[0e12bcd2d685904abf22431381000c68ca0af230] Comment 717\n", |
| 392 | + "[5eda263aaa5d0914b5871f546db26b7914895271] Breaking argument type\n", |
370 | 393 | "running python squares.py 2\n",
|
| 394 | + "Traceback (most recent call last):\n", |
| 395 | + " File \"squares.py\", line 9, in <module>\n", |
| 396 | + " print(integer**2)\n", |
| 397 | + "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'\n", |
371 | 398 | "Bisecting: 15 revisions left to test after this (roughly 4 steps)\n",
|
372 |
| - "[cd59a9f75102f1b49863ad424fc35dc802522ccd] Comment 702\n", |
| 399 | + "[c9097be29af1b3437905feb0969669820ea81283] Comment 577\n", |
373 | 400 | "running python squares.py 2\n",
|
374 | 401 | "4\n",
|
375 | 402 | "Bisecting: 7 revisions left to test after this (roughly 3 steps)\n",
|
376 |
| - "[a105ae052d898733015676ac6709b1ffe88ed8bd] Comment 709\n", |
| 403 | + "[8021453f7f6fde4319a21337968832be1cc4151a] Comment 585\n", |
377 | 404 | "running python squares.py 2\n",
|
| 405 | + "4\n", |
378 | 406 | "Bisecting: 3 revisions left to test after this (roughly 2 steps)\n",
|
379 |
| - "[08508dd54091baa9e00c3599cb83cd0cda5b5837] Comment 706\n", |
| 407 | + "[f373b49b6545427ce00c991ca112bdc65d712fbf] Comment 589\n", |
380 | 408 | "running python squares.py 2\n",
|
381 | 409 | "4\n",
|
382 | 410 | "Bisecting: 1 revision left to test after this (roughly 1 step)\n",
|
383 |
| - "[7ced4763b6ab1600aab31d18fd2592186fd78b89] Comment 707\n", |
| 411 | + "[66f6530a9d0a459fc0ba132c17451d281449ffee] Comment 591\n", |
384 | 412 | "running python squares.py 2\n",
|
| 413 | + "4\n", |
385 | 414 | "Bisecting: 0 revisions left to test after this (roughly 0 steps)\n",
|
386 |
| - "[ebb3f4a5f4000c28bbc12d4d0187bbdad3d92241] Breaking argument type\n", |
| 415 | + "[1694ac7328d0a379362dec982d8d3afe14cc98b8] Comment 592\n", |
387 | 416 | "running python squares.py 2\n",
|
388 |
| - "ebb3f4a5f4000c28bbc12d4d0187bbdad3d92241 is the first bad commit\n", |
389 |
| - "commit ebb3f4a5f4000c28bbc12d4d0187bbdad3d92241\n", |
| 417 | + "4\n", |
| 418 | + "5eda263aaa5d0914b5871f546db26b7914895271 is the first bad commit\n", |
| 419 | + "commit 5eda263aaa5d0914b5871f546db26b7914895271\n", |
390 | 420 | "Author: Shawn Siefkas <[email protected]>\n",
|
391 | 421 | "Date: Thu Nov 14 09:23:55 2013 -0600\n",
|
392 | 422 | "\n",
|
393 | 423 | " Breaking argument type\n",
|
394 | 424 | "\n",
|
395 |
| - ":100644 100644 430222f37d6aad3ba2b7f235991473e680c7e4d8 03bc808166ca5cd0a8cca51cfb522e0724a31bc6 M\tsquares.py\n", |
| 425 | + " squares.py | 2 +-\n", |
| 426 | + " 1 file changed, 1 insertion(+), 1 deletion(-)\n", |
396 | 427 | "bisect run success\n"
|
397 | 428 | ]
|
398 | 429 | },
|
399 | 430 | {
|
400 | 431 | "name": "stderr",
|
401 | 432 | "output_type": "stream",
|
402 | 433 | "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" |
| 434 | + "Previous HEAD position was 1694ac7 Comment 592\n", |
| 435 | + "Switched to branch 'buggy'\n" |
425 | 436 | ]
|
426 | 437 | }
|
427 | 438 | ],
|
|
430 | 441 | "git bisect start\n",
|
431 | 442 | "git bisect bad HEAD # We know the current state is broken\n",
|
432 | 443 | "git bisect good master # We know master is good\n",
|
433 |
| - "git bisect run python squares.py 2" |
| 444 | + "git bisect run python squares.py 2 &> gitbisect.out\n", |
| 445 | + "cat gitbisect.out" |
434 | 446 | ]
|
435 | 447 | },
|
436 | 448 | {
|
|
0 commit comments