<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/bisect.c, branch v2.26.0-rc2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.26.0-rc2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.26.0-rc2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2020-02-19T17:37:15Z</updated>
<entry>
<title>bisect: libify `bisect_next_all`</title>
<updated>2020-02-19T17:37:15Z</updated>
<author>
<name>Pranit Bauva</name>
<email>pranit.bauva@gmail.com</email>
</author>
<published>2020-02-17T08:40:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6c69f2223394c200cce1289ac9200f781ef14da7'/>
<id>urn:sha1:6c69f2223394c200cce1289ac9200f781ef14da7</id>
<content type='text'>
Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.

Emulate try catch in C by converting `exit(&lt;positive-value&gt;)` to
`return &lt;negative-value&gt;`. Follow POSIX conventions to return
&lt;negative-value&gt; to indicate error.

All the functions calling `bisect_next_all()` are already able to
handle return values from it.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Pranit Bauva &lt;pranit.bauva@gmail.com&gt;
Signed-off-by: Tanushree Tumane &lt;tanushreetumane@gmail.com&gt;
Signed-off-by: Miriam Rubio &lt;mirucam@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: libify `handle_bad_merge_base` and its dependents</title>
<updated>2020-02-19T17:37:15Z</updated>
<author>
<name>Pranit Bauva</name>
<email>pranit.bauva@gmail.com</email>
</author>
<published>2020-02-17T08:40:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=9ec598e0d55ff263e47d95e7d4decef1eb1b6ac6'/>
<id>urn:sha1:9ec598e0d55ff263e47d95e7d4decef1eb1b6ac6</id>
<content type='text'>
Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.

Emulate try catch in C by converting `exit(&lt;positive-value&gt;)` to
`return &lt;negative-value&gt;`. Follow POSIX conventions to return
&lt;negative-value&gt; to indicate error.

Update all callers to handle the error returns.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Pranit Bauva &lt;pranit.bauva@gmail.com&gt;
Signed-off-by: Tanushree Tumane &lt;tanushreetumane@gmail.com&gt;
Signed-off-by: Miriam Rubio &lt;mirucam@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: libify `check_good_are_ancestors_of_bad` and its dependents</title>
<updated>2020-02-19T17:37:14Z</updated>
<author>
<name>Pranit Bauva</name>
<email>pranit.bauva@gmail.com</email>
</author>
<published>2020-02-17T08:40:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=45b6370812cb9bc50212d50f071c8ae5dd851698'/>
<id>urn:sha1:45b6370812cb9bc50212d50f071c8ae5dd851698</id>
<content type='text'>
Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.

Emulate try catch in C by converting `exit(&lt;positive-value&gt;)` to
`return &lt;negative-value&gt;`. Follow POSIX conventions to return
&lt;negative-value&gt; to indicate error.

Code that turns BISECT_INTERNAL_SUCCESS_MERGE_BASE (-11)
 to BISECT_OK (0) from `check_good_are_ancestors_of_bad()` has been moved to
`cmd_bisect__helper()`.

Update all callers to handle the error returns.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Pranit Bauva &lt;pranit.bauva@gmail.com&gt;
Signed-off-by: Tanushree Tumane &lt;tanushreetumane@gmail.com&gt;
Signed-off-by: Miriam Rubio &lt;mirucam@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: libify `check_merge_bases` and its dependents</title>
<updated>2020-02-19T17:37:14Z</updated>
<author>
<name>Pranit Bauva</name>
<email>pranit.bauva@gmail.com</email>
</author>
<published>2020-02-17T08:40:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=cdd4dc2d6a3e420178100efc780a987495a1a3bd'/>
<id>urn:sha1:cdd4dc2d6a3e420178100efc780a987495a1a3bd</id>
<content type='text'>
Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.

Emulate try catch in C by converting `exit(&lt;positive-value&gt;)` to
`return &lt;negative-value&gt;`. Follow POSIX conventions to return
&lt;negative-value&gt; to indicate error.

In `check_merge_bases()` there is an early success special case,
so we have introduced special error code
BISECT_INTERNAL_SUCCESS_MERGE_BASE (-11) which indicates early
success. This BISECT_INTERNAL_SUCCESS_MERGE_BASE is converted back
to BISECT_OK (0) in `check_good_are_ancestors_of_bad()`.

Update all callers to handle the error returns.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Pranit Bauva &lt;pranit.bauva@gmail.com&gt;
Signed-off-by: Tanushree Tumane &lt;tanushreetumane@gmail.com&gt;
Signed-off-by: Miriam Rubio &lt;mirucam@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: libify `bisect_checkout`</title>
<updated>2020-02-19T17:37:14Z</updated>
<author>
<name>Pranit Bauva</name>
<email>pranit.bauva@gmail.com</email>
</author>
<published>2020-02-17T08:40:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e8e3ce67185fd493a07d84a5ce21b469701f8f64'/>
<id>urn:sha1:e8e3ce67185fd493a07d84a5ce21b469701f8f64</id>
<content type='text'>
Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.

Emulate try catch in C by converting `exit(&lt;positive-value&gt;)` to
`return &lt;negative-value&gt;`. Follow POSIX conventions to return
&lt;negative-value&gt; to indicate error.

Turn `exit()` to `return` calls in `bisect_checkout()`.
Changes related to return values have no bad side effects on the
code that calls `bisect_checkout()`.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Pranit Bauva &lt;pranit.bauva@gmail.com&gt;
Signed-off-by: Tanushree Tumane &lt;tanushreetumane@gmail.com&gt;
Signed-off-by: Miriam Rubio &lt;mirucam@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: libify `exit_if_skipped_commits` to `error_if_skipped*` and its dependents</title>
<updated>2020-02-19T17:37:14Z</updated>
<author>
<name>Pranit Bauva</name>
<email>pranit.bauva@gmail.com</email>
</author>
<published>2020-02-17T08:40:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ce58b5d8b128568e9b4f37703377cbc22eaf00f5'/>
<id>urn:sha1:ce58b5d8b128568e9b4f37703377cbc22eaf00f5</id>
<content type='text'>
Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.

Emulate try catch in C by converting `exit(&lt;positive-value&gt;)` to
`return &lt;negative-value&gt;`. Follow POSIX conventions to return
&lt;negative-value&gt; to indicate error.

Update all callers to handle the error returns.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Pranit Bauva &lt;pranit.bauva@gmail.com&gt;
Signed-off-by: Tanushree Tumane &lt;tanushreetumane@gmail.com&gt;
Signed-off-by: Miriam Rubio &lt;mirucam@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: add enum to represent bisect returning codes</title>
<updated>2020-02-19T17:37:14Z</updated>
<author>
<name>Miriam Rubio</name>
<email>mirucam@gmail.com</email>
</author>
<published>2020-02-17T08:40:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=680e8a01e57cd383048bf4e7d9668ce715d6d649'/>
<id>urn:sha1:680e8a01e57cd383048bf4e7d9668ce715d6d649</id>
<content type='text'>
Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.

Create an enum called `bisect_error` with the bisecting return codes
to use in `bisect.c` libification process.

Change bisect_next_all() to make it return this enum.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Miriam Rubio &lt;mirucam@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: use the standard 'if (!var)' way to check for 0</title>
<updated>2020-02-19T17:37:14Z</updated>
<author>
<name>Miriam Rubio</name>
<email>mirucam@gmail.com</email>
</author>
<published>2020-02-17T08:40:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b8e3b2f33994de25c068021e388dbef72a2cdc4a'/>
<id>urn:sha1:b8e3b2f33994de25c068021e388dbef72a2cdc4a</id>
<content type='text'>
Instead of using 'var == 0' in an if condition, let's use '!var' and
make 'bisect.c' more consistent with the rest of the code.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Miriam Rubio &lt;mirucam@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: switch to using the_hash_algo</title>
<updated>2019-08-19T22:04:58Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-08-18T20:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=95518faac1828d077de09b4049c9c4a6602c8ae2'/>
<id>urn:sha1:95518faac1828d077de09b4049c9c4a6602c8ae2</id>
<content type='text'>
Instead of using GIT_SHA1_HEXSZ, use the_hash_algo so that the code is
hash size independent.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: make diff-tree output prettier</title>
<updated>2019-02-28T22:31:38Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-02-22T06:23:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b02be8b901bc65de1b75014c0dade67b233569ff'/>
<id>urn:sha1:b02be8b901bc65de1b75014c0dade67b233569ff</id>
<content type='text'>
After completing a bisection, we print out the commit we found using an
internal version of diff-tree. The result is aesthetically lacking:

  - it shows a raw diff, which is generally less informative for human
    readers than "--stat --summary" (which we already decided was nice
    for humans in format-patch's output).

  - by not abbreviating hashes, the result is likely to wrap on most
    people's terminals

  - we don't use "-r", so if the commit touched files in a directory,
    you only get to see the top-level directory mentioned

  - we don't specify "--cc" or similar, so merges print nothing (not
    even the commit message!)

Even though bisect might be driven by scripts, there's no reason to
consider this part of the output as machine-readable (if anything, the
initial "$hash is the first bad commit" might be parsed, but we won't
touch that here). Let's make it prettier and more informative for a
human reading the output.

While we're tweaking the options, let's also switch to using the diff
"ui" config. If we're accepting that this is human-readable output, then
we should respect the user's options for how to display it.

Note that we have to touch a few tests in t6030. These check bisection
in a corrupted repository (it's missing a subtree). They didn't fail
with the previous code, because it didn't actually recurse far enough in
the diff to find the broken tree. But now we'll see the corruption and
complain.

Adjusting the tests to expect the die() is the best fix. We still
confirm that we're able to bisect within the broken repo. And we'll
still print "$hash is the first bad commit" as usual before dying;
showing that is a reasonable outcome in a corrupt repository (and was
what might happen already, if the root tree was corrupt).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
