<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/bisect.c, branch v2.3.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-01-07T20:55:05Z</updated>
<entry>
<title>Merge branch 'jc/merge-bases'</title>
<updated>2015-01-07T20:55:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T20:55:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=098501527f2b5628f086d3d9d2fda87220c069a5'/>
<id>urn:sha1:098501527f2b5628f086d3d9d2fda87220c069a5</id>
<content type='text'>
The get_merge_bases*() API was easy to misuse by careless
copy&amp;paste coders, leaving object flags tainted in the commits that
needed to be traversed.

* jc/merge-bases:
  get_merge_bases(): always clean-up object flags
  bisect: clean flags after checking merge bases
</content>
</entry>
<entry>
<title>get_merge_bases(): always clean-up object flags</title>
<updated>2014-10-30T19:51:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-30T19:20:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ce406ccb85c4546b6d19309a6101b37c7bd952e'/>
<id>urn:sha1:2ce406ccb85c4546b6d19309a6101b37c7bd952e</id>
<content type='text'>
The callers of get_merge_bases() can choose to leave object flags
used during the merge-base traversal by passing cleanup=0 as a
parameter, but in practice a very few callers can afford to do so
(namely, "git merge-base"), as they need to compute merge base in
preparation for other processing of their own and they need to see
the object without contaminate flags.

Change the function signature of get_merge_bases_many() and
get_merge_bases() to drop the cleanup parameter, so that the
majority of the callers do not have to say ", 1" at the end.

Give a new get_merge_bases_many_dirty() API to support only a few
callers that know they do not need to spend cycles cleaning up the
object flags.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: clean flags after checking merge bases</title>
<updated>2014-10-30T19:51:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-30T19:01:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d76c9e95b435b660f8f1b3e01d3c2f934e2ec441'/>
<id>urn:sha1:d76c9e95b435b660f8f1b3e01d3c2f934e2ec441</id>
<content type='text'>
Unless there is a good reason to belieave that a particular
invocation of a get_merge_bases*() is the last one that cares about
the object flags the computation of merge bases leaves on the
objects, the "cleanup" parameter should always be true, and I do not
think there is one in this codepath.

Found by code inspection.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/name-decoration-alloc'</title>
<updated>2014-09-11T17:33:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-11T17:33:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ebe6a825a1ff12e12905e28265aa30e269700d6'/>
<id>urn:sha1:1ebe6a825a1ff12e12905e28265aa30e269700d6</id>
<content type='text'>
The API to allocate the structure to keep track of commit
decoration was cumbersome to use, inviting lazy code to
overallocate memory.

* jk/name-decoration-alloc:
  log-tree: use FLEX_ARRAY in name_decoration
  log-tree: make name_decoration hash static
  log-tree: make add_name_decoration a public function
</content>
</entry>
<entry>
<title>log-tree: make add_name_decoration a public function</title>
<updated>2014-08-26T17:33:01Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-08-26T10:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=662174d299a2221016a8756d35d485b576ebcec2'/>
<id>urn:sha1:662174d299a2221016a8756d35d485b576ebcec2</id>
<content type='text'>
The log-tree code keeps a "struct decoration" hash to show
text decorations for each commit during log traversals. It
makes this available to other files by providing global
access to the hash. This can result in other code adding
entries that do not conform to what log-tree expects.

For example, the bisect code adds its own "dist"
decorations to be shown. Originally the bisect code was
correct, but when the name_decoration code grew a new field
in eb3005e (commit.h: add 'type' to struct name_decoration,
2010-06-19), the bisect code was not updated. As a result,
the log-tree code can access uninitialized memory and even
segfault.

We can fix this by making name_decoration's adding function
public. If all callers use it, then any changes to struct
initialization only need to happen in one place (and because
the members come in as parameters, the compiler can notice a
caller who does not supply enough information).

As a bonus, this also means that the decoration hashes
created by the bisect code will use less memory (previously
we over-allocated space for the distance integer, but now we
format it into a temporary buffer and copy it to the final
flex-array).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/log-show-linear-break'</title>
<updated>2014-04-03T19:38:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-03T19:38:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b407d40933f9c37af16ca3dc275e615ab4fdd8c5'/>
<id>urn:sha1:b407d40933f9c37af16ca3dc275e615ab4fdd8c5</id>
<content type='text'>
Attempts to show where a single-strand-of-pearls break in "git log"
output.

* nd/log-show-linear-break:
  log: add --show-linear-break to help see non-linear history
  object.h: centralize object flag allocation
</content>
</entry>
<entry>
<title>object.h: centralize object flag allocation</title>
<updated>2014-03-25T22:09:24Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-03-25T13:23:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=208acbfb82f722fb22320c381e7da8c8fb2e37e8'/>
<id>urn:sha1:208acbfb82f722fb22320c381e7da8c8fb2e37e8</id>
<content type='text'>
While the field "flags" is mainly used by the revision walker, it is
also used in many other places. Centralize the whole flag allocation to
one place for a better overview (and easier to move flags if we have
too).

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ep/varscope'</title>
<updated>2014-02-27T22:01:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-02-27T22:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=043478308feec3cda9b3473bc0b79396cb9d4db6'/>
<id>urn:sha1:043478308feec3cda9b3473bc0b79396cb9d4db6</id>
<content type='text'>
Shrink lifetime of variables by moving their definitions to an
inner scope where appropriate.

* ep/varscope:
  builtin/gc.c: reduce scope of variables
  builtin/fetch.c: reduce scope of variable
  builtin/commit.c: reduce scope of variables
  builtin/clean.c: reduce scope of variable
  builtin/blame.c: reduce scope of variables
  builtin/apply.c: reduce scope of variables
  bisect.c: reduce scope of variable
</content>
</entry>
<entry>
<title>bisect.c: reduce scope of variable</title>
<updated>2014-01-31T18:44:04Z</updated>
<author>
<name>Elia Pinto</name>
<email>gitter.spiros@gmail.com</email>
</author>
<published>2014-01-29T13:25:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4824d1b8c2d0e9e6a549c836aa6a7698fdba021b'/>
<id>urn:sha1:4824d1b8c2d0e9e6a549c836aa6a7698fdba021b</id>
<content type='text'>
Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>replace {pre,suf}fixcmp() with {starts,ends}_with()</title>
<updated>2013-12-05T22:13:21Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-11-30T20:55:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=59556548230e617b837343c2c07e357e688e2ca4'/>
<id>urn:sha1:59556548230e617b837343c2c07e357e688e2ca4</id>
<content type='text'>
Leaving only the function definitions and declarations so that any
new topic in flight can still make use of the old functions, replace
existing uses of the prefixcmp() and suffixcmp() with new API
functions.

The change can be recreated by mechanically applying this:

    $ git grep -l -e prefixcmp -e suffixcmp -- \*.c |
      grep -v strbuf\\.c |
      xargs perl -pi -e '
        s|!prefixcmp\(|starts_with\(|g;
        s|prefixcmp\(|!starts_with\(|g;
        s|!suffixcmp\(|ends_with\(|g;
        s|suffixcmp\(|!ends_with\(|g;
      '

on the result of preparatory changes in this series.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
