From 376f57f9c63575c936b718926444ebefab8eb1af Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:02:56 +0100 Subject: [PATCH 01/10] commit number 493 --- get_pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_pi.py b/get_pi.py index 13406a2..46e0bcf 100644 --- a/get_pi.py +++ b/get_pi.py @@ -1,4 +1,4 @@ -# commit 492 +# commit 493 t0 = 3.0 + 0.16666666666666666 t1 = t0 + -0.03333333333333333 t2 = t1 + 0.011904761904761904 @@ -10,7 +10,7 @@ t7 = t6 + 0.4312830065359477 t8 = t7 + 0.0005847953216374269 t9 = t8 + -0.0004329004329004329 t10 = t9 + 0.00032938076416337287 -t11 = t10 + -0.0002564102564102564 # this comment is added to obfuscate git blame -t12 = t11 + 0.0002035002035002035 +t11 = t10 + -0.0002564102564102564 +t12 = t11 + 0.0002035002035002035 # this comment is added to obfuscate git blame t13 = t12 + -0.00016420361247947455 print('%.2f' % (t13)) From 55605b632a757ac27181bf9a48654c5e16276e65 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:02:56 +0100 Subject: [PATCH 02/10] commit number 494 --- get_pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_pi.py b/get_pi.py index 46e0bcf..260c59b 100644 --- a/get_pi.py +++ b/get_pi.py @@ -1,4 +1,4 @@ -# commit 493 +# commit 494 t0 = 3.0 + 0.16666666666666666 t1 = t0 + -0.03333333333333333 t2 = t1 + 0.011904761904761904 @@ -11,6 +11,6 @@ t8 = t7 + 0.0005847953216374269 t9 = t8 + -0.0004329004329004329 t10 = t9 + 0.00032938076416337287 t11 = t10 + -0.0002564102564102564 -t12 = t11 + 0.0002035002035002035 # this comment is added to obfuscate git blame -t13 = t12 + -0.00016420361247947455 +t12 = t11 + 0.0002035002035002035 +t13 = t12 + -0.00016420361247947455 # this comment is added to obfuscate git blame print('%.2f' % (t13)) From 4db973014b69e4129389522b11e0739f664aa3f0 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:02:56 +0100 Subject: [PATCH 03/10] commit number 495 --- get_pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_pi.py b/get_pi.py index 260c59b..d718a13 100644 --- a/get_pi.py +++ b/get_pi.py @@ -1,4 +1,4 @@ -# commit 494 +# commit 495 t0 = 3.0 + 0.16666666666666666 t1 = t0 + -0.03333333333333333 t2 = t1 + 0.011904761904761904 @@ -12,5 +12,5 @@ t9 = t8 + -0.0004329004329004329 t10 = t9 + 0.00032938076416337287 t11 = t10 + -0.0002564102564102564 t12 = t11 + 0.0002035002035002035 -t13 = t12 + -0.00016420361247947455 # this comment is added to obfuscate git blame -print('%.2f' % (t13)) +t13 = t12 + -0.00016420361247947455 +print('%.2f' % (t13)) # this comment is added to obfuscate git blame From 82bdd9718c3319f395b4283a786be765469739f1 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:02:56 +0100 Subject: [PATCH 04/10] commit number 496 --- get_pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_pi.py b/get_pi.py index d718a13..a062540 100644 --- a/get_pi.py +++ b/get_pi.py @@ -1,5 +1,5 @@ -# commit 495 -t0 = 3.0 + 0.16666666666666666 +# commit 496 +t0 = 3.0 + 0.16666666666666666 # this comment is added to obfuscate git blame t1 = t0 + -0.03333333333333333 t2 = t1 + 0.011904761904761904 t3 = t2 + -0.005555555555555556 @@ -13,4 +13,4 @@ t10 = t9 + 0.00032938076416337287 t11 = t10 + -0.0002564102564102564 t12 = t11 + 0.0002035002035002035 t13 = t12 + -0.00016420361247947455 -print('%.2f' % (t13)) # this comment is added to obfuscate git blame +print('%.2f' % (t13)) From d080ed2b8d547cb29fdb07ee0a85b19209217cff Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:02:56 +0100 Subject: [PATCH 05/10] commit number 497 --- get_pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_pi.py b/get_pi.py index a062540..de1458d 100644 --- a/get_pi.py +++ b/get_pi.py @@ -1,6 +1,6 @@ -# commit 496 -t0 = 3.0 + 0.16666666666666666 # this comment is added to obfuscate git blame -t1 = t0 + -0.03333333333333333 +# commit 497 +t0 = 3.0 + 0.16666666666666666 +t1 = t0 + -0.03333333333333333 # this comment is added to obfuscate git blame t2 = t1 + 0.011904761904761904 t3 = t2 + -0.005555555555555556 t4 = t3 + 0.0030303030303030303 From aeb7a3836d7f8174867f744d85ce21fe47ace5ec Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:02:56 +0100 Subject: [PATCH 06/10] commit number 498 --- get_pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_pi.py b/get_pi.py index de1458d..d6c408a 100644 --- a/get_pi.py +++ b/get_pi.py @@ -1,7 +1,7 @@ -# commit 497 +# commit 498 t0 = 3.0 + 0.16666666666666666 -t1 = t0 + -0.03333333333333333 # this comment is added to obfuscate git blame -t2 = t1 + 0.011904761904761904 +t1 = t0 + -0.03333333333333333 +t2 = t1 + 0.011904761904761904 # this comment is added to obfuscate git blame t3 = t2 + -0.005555555555555556 t4 = t3 + 0.0030303030303030303 t5 = t4 + -0.0018315018315018315 From ca9fe5abedb3d27f4a7998ad5b72b8769acdb3d8 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:02:56 +0100 Subject: [PATCH 07/10] commit number 499 --- get_pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_pi.py b/get_pi.py index d6c408a..f861934 100644 --- a/get_pi.py +++ b/get_pi.py @@ -1,8 +1,8 @@ -# commit 498 +# commit 499 t0 = 3.0 + 0.16666666666666666 t1 = t0 + -0.03333333333333333 -t2 = t1 + 0.011904761904761904 # this comment is added to obfuscate git blame -t3 = t2 + -0.005555555555555556 +t2 = t1 + 0.011904761904761904 +t3 = t2 + -0.005555555555555556 # this comment is added to obfuscate git blame t4 = t3 + 0.0030303030303030303 t5 = t4 + -0.0018315018315018315 t6 = t5 + 0.0011904761904761906 From 15c23f04e5a168ba347b495c166b63775cc63599 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:02:56 +0100 Subject: [PATCH 08/10] commit number 500 --- get_pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_pi.py b/get_pi.py index f861934..f225e34 100644 --- a/get_pi.py +++ b/get_pi.py @@ -1,9 +1,9 @@ -# commit 499 +# commit 500 t0 = 3.0 + 0.16666666666666666 t1 = t0 + -0.03333333333333333 t2 = t1 + 0.011904761904761904 -t3 = t2 + -0.005555555555555556 # this comment is added to obfuscate git blame -t4 = t3 + 0.0030303030303030303 +t3 = t2 + -0.005555555555555556 +t4 = t3 + 0.0030303030303030303 # this comment is added to obfuscate git blame t5 = t4 + -0.0018315018315018315 t6 = t5 + 0.0011904761904761906 t7 = t6 + 0.4312830065359477 From 5901380a6d6f51e5cca77e82823a8268ab84fbd0 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 29 Mar 2019 16:22:41 +0100 Subject: [PATCH 09/10] add license --- LICENSE | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fde1c21 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014-2019, Radovan Bast +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of git-bisect-exercise nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From b22aef12ef3a652d759bdabb39d64a27af664f38 Mon Sep 17 00:00:00 2001 From: Benjamin Hackl Date: Thu, 10 Oct 2024 23:55:17 +0200 Subject: [PATCH 10/10] added readme --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a7be7eb --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +[![License](https://img.shields.io/badge/license-%20BSD--3-blue.svg)](../master/LICENSE) + + +## Git bisect exercise + +### Motivation + +The motivation for this exercise is to be able to do archaeology with Git on a +source code where the bug is difficult to see visually. **Finding the offending +commit is often more than half the debugging**. + + +### Background + +The script `get_pi.py` approximates pi using terms of the Nilakantha series. It +should produce 3.14 but it does not. The script broke at some point and +produces 3.57 using the last commit: + +``` +$ python get_pi.py + +3.57 +``` + +At some point within the 500 first commits, an error was introduced. The only +thing we know is that the first commit worked correctly. + + +### Your task + +Clone or fork this repository and use `git bisect` to find the commit which +broke the computation.