<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reachable.c, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-06-06T17:29:12Z</updated>
<entry>
<title>clear parsed flag when we free tree buffers</title>
<updated>2013-06-06T17:29:12Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-06-05T22:37:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e454b9a31840102807f1eee527ee717bf134102'/>
<id>urn:sha1:6e454b9a31840102807f1eee527ee717bf134102</id>
<content type='text'>
Many code paths will free a tree object's buffer and set it
to NULL after finishing with it in order to keep memory
usage down during a traversal. However, out of 8 sites that
do this, only one actually unsets the "parsed" flag back.
Those sites that don't are setting a trap for later users of
the tree object; even after calling parse_tree, the buffer
will remain NULL, causing potential segfaults.

It is not known whether this is triggerable in the current
code. Most commands do not do an in-memory traversal
followed by actually using the objects again. However, it
does not hurt to be safe for future callers.

In most cases, we can abstract this out to a
"free_tree_buffer" helper. However, there are two
exceptions:

  1. The fsck code relies on the parsed flag to know that we
     were able to parse the object at one point. We can
     switch this to using a flag in the "flags" field.

  2. The index-pack code sets the buffer to NULL but does
     not free it (it is freed by a caller). We should still
     unset the parsed flag here, but we cannot use our
     helper, as we do not want to free the buffer.

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>use parse_object_or_die instead of die("bad object")</title>
<updated>2013-03-17T19:52:14Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-03-17T08:23:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f7892d181752187513f10b13f2272fa46c9c8422'/>
<id>urn:sha1:f7892d181752187513f10b13f2272fa46c9c8422</id>
<content type='text'>
Some call-sites do:

  o = parse_object(sha1);
  if (!o)
	  die("bad object %s", some_name);

We can now handle that as a one-liner, and get more
consistent output.

In the third case of this patch, it looks like we are losing
information, as the existing message also outputs the sha1
hex; however, parse_object will already have written a more
specific complaint about the sha1, so there is no point in
repeating it here.

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>reachable: per-object progress</title>
<updated>2011-11-08T06:12:19Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-11-08T05:37:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b26abc0f59ce7899257f75d63ce836e1a6566bd'/>
<id>urn:sha1:0b26abc0f59ce7899257f75d63ce836e1a6566bd</id>
<content type='text'>
The current progress code really just counts commits.
This patch makes it count all objects, giving us a "total"
count close to what a repack would show. This is nice when
using "git gc", which will usually have just repacked the
whole repo.

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>prune: show progress while marking reachable objects</title>
<updated>2011-11-08T06:12:19Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2011-11-05T12:00:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc347195ccfbc87b6e445f5c31a5500e1df6c9b5'/>
<id>urn:sha1:dc347195ccfbc87b6e445f5c31a5500e1df6c9b5</id>
<content type='text'>
prune already shows progress meter while pruning. The marking part may
take a few seconds or more, depending on repository size. Show
progress meter during this time 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>Remove unused variables</title>
<updated>2011-03-22T18:43:27Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2011-03-22T12:50:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0aa335c95974caebcc972cd63a11e6ff73b1612'/>
<id>urn:sha1:c0aa335c95974caebcc972cd63a11e6ff73b1612</id>
<content type='text'>
Noticed by gcc 4.6.0.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object.h: Add OBJECT_ARRAY_INIT macro and make use of it.</title>
<updated>2010-08-30T05:42:49Z</updated>
<author>
<name>Thiago Farina</name>
<email>tfransosi@gmail.com</email>
</author>
<published>2010-08-29T02:04:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3cd474599f1ede41863c523ddf76c94941b08164'/>
<id>urn:sha1:3cd474599f1ede41863c523ddf76c94941b08164</id>
<content type='text'>
Signed-off-by: Thiago Farina &lt;tfransosi@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>process_{tree,blob}: Remove useless xstrdup calls</title>
<updated>2009-04-09T05:58:43Z</updated>
<author>
<name>Björn Steinbrink</name>
<email>B.Steinbrink@gmx.de</email>
</author>
<published>2009-04-08T11:28:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de551d472ed65fa570d9456e8498348fe4c8e7d8'/>
<id>urn:sha1:de551d472ed65fa570d9456e8498348fe4c8e7d8</id>
<content type='text'>
The name of the processed object was duplicated for passing it to
add_object(), but that already calls path_name, which allocates a new
string anyway. So the memory allocated by the xstrdup calls just went
nowhere, leaking memory.

This reduces the RSS usage for a "rev-list --all --objects" by about 10% on
the gentoo repo (fully packed) as well as linux-2.6.git:

    gentoo:
                    | old           | new
    ----------------|-------------------------------
    RSS             |       1537284 |       1388408
    VSZ             |       1816852 |       1667952
    time elapsed    |       1:49.62 |       1:48.99
    min. page faults|        417178 |        379919

    linux-2.6.git:
                    | old           | new
    ----------------|-------------------------------
    RSS             |        324452 |        292996
    VSZ             |        491792 |        460376
    time elapsed    |       0:14.53 |       0:14.28
    min. page faults|         89360 |         81613

Signed-off-by: Björn Steinbrink &lt;B.Steinbrink@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mk/maint-parse-careful'</title>
<updated>2008-02-19T04:56:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-02-19T04:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee4f06c0a60d8b17efdd8f6a3332f175f6aafe0e'/>
<id>urn:sha1:ee4f06c0a60d8b17efdd8f6a3332f175f6aafe0e</id>
<content type='text'>
* mk/maint-parse-careful:
  peel_onion: handle NULL
  check return value from parse_commit() in various functions
  parse_commit: don't fail, if object is NULL
  revision.c: handle tag-&gt;tagged == NULL
  reachable.c::process_tree/blob: check for NULL
  process_tag: handle tag-&gt;tagged == NULL
  check results of parse_commit in merge_bases
  list-objects.c::process_tree/blob: check for NULL
  reachable.c::add_one_tree: handle NULL from lookup_tree
  mark_blob/tree_uninteresting: check for NULL
  get_sha1_oneline: check return value of parse_object
  read_object_with_reference: don't read beyond the buffer
</content>
</entry>
<entry>
<title>reachable.c::process_tree/blob: check for NULL</title>
<updated>2008-02-19T03:25:26Z</updated>
<author>
<name>Martin Koegler</name>
<email>mkoegler@auto.tuwien.ac.at</email>
</author>
<published>2008-02-18T20:48:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f7de5a56b75109e1d6651ee2b5bf7f496a5eb18b'/>
<id>urn:sha1:f7de5a56b75109e1d6651ee2b5bf7f496a5eb18b</id>
<content type='text'>
As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler &lt;mkoegler@auto.tuwien.ac.at&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>process_tag: handle tag-&gt;tagged == NULL</title>
<updated>2008-02-19T03:25:26Z</updated>
<author>
<name>Martin Koegler</name>
<email>mkoegler@auto.tuwien.ac.at</email>
</author>
<published>2008-02-18T20:47:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc36934791f3857b62348b6a9e071cdf989a9177'/>
<id>urn:sha1:cc36934791f3857b62348b6a9e071cdf989a9177</id>
<content type='text'>
Signed-off-by: Martin Koegler &lt;mkoegler@auto.tuwien.ac.at&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
