<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reachable.c, branch v1.6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2009-04-09T05:58:43Z</updated>
<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>
<entry>
<title>reachable.c::add_one_tree: handle NULL from lookup_tree</title>
<updated>2008-02-19T03:25:22Z</updated>
<author>
<name>Martin Koegler</name>
<email>mkoegler@auto.tuwien.ac.at</email>
</author>
<published>2008-02-18T20:47:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c34066358a604e3ccb6afcf5679fa8a84be79936'/>
<id>urn:sha1:c34066358a604e3ccb6afcf5679fa8a84be79936</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>
<entry>
<title>check return code of prepare_revision_walk</title>
<updated>2008-02-18T07:51:12Z</updated>
<author>
<name>Martin Koegler</name>
<email>mkoegler@auto.tuwien.ac.at</email>
</author>
<published>2008-02-18T07:31:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d51e1b5b84bde24f9a19e3cee603f0b57f62001'/>
<id>urn:sha1:3d51e1b5b84bde24f9a19e3cee603f0b57f62001</id>
<content type='text'>
A failure in prepare_revision_walk can be caused by
a not parseable object.

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>Make on-disk index representation separate from in-core one</title>
<updated>2008-01-21T20:44:31Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-01-15T00:03:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a51ed66f653c248993b3c4a61932e47933d835e'/>
<id>urn:sha1:7a51ed66f653c248993b3c4a61932e47933d835e</id>
<content type='text'>
This converts the index explicitly on read and write to its on-disk
format, allowing the in-core format to contain more flags, and be
simpler.

In particular, the in-core format is now host-endian (as opposed to the
on-disk one that is network endian in order to be able to be shared
across machines) and as a result we can dispense with all the
htonl/ntohl on accesses to the cache_entry fields.

This will make it easier to make use of various temporary flags that do
not exist in the on-disk format.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint'</title>
<updated>2007-07-03T00:12:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-07-02T23:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b941ffac506d3f57246e46a8913da614e62a1d48'/>
<id>urn:sha1:b941ffac506d3f57246e46a8913da614e62a1d48</id>
<content type='text'>
* maint:
  Make git-prune submodule aware (and fix a SEGFAULT in the process)
</content>
</entry>
<entry>
<title>Make git-prune submodule aware (and fix a SEGFAULT in the process)</title>
<updated>2007-07-02T23:41:18Z</updated>
<author>
<name>Andy Parkins</name>
<email>andyparkins@gmail.com</email>
</author>
<published>2007-07-02T12:56:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d2244ba74f5207b9f7f9f1b4efbcccacbbb2c7b'/>
<id>urn:sha1:8d2244ba74f5207b9f7f9f1b4efbcccacbbb2c7b</id>
<content type='text'>
I ran git-prune on a repository and got this:

 $ git-prune
 error: Object 228f8065b930120e35fc0c154c237487ab02d64a is a blob, not a commit
 Segmentation fault (core dumped)

This repository was a strange one in that it was being used to provide
its own submodule.  That is, the repository was cloned into a
subdirectory, an independent branch checked out in that subdirectory,
and then it was marked as a submodule.  git-prune then failed in the
above manner.

The problem was that git-prune was not submodule aware in two areas.

Linus said:

 &gt; So what happens is that something traverses a tree object, looks at each
 &gt; entry, sees that it's not a tree, and tries to look it up as a blob. But
 &gt; subprojects are commits, not blobs, and then when you look at the object
 &gt; more closely, you get the above kind of object type confusion.

and included a patch to add an S_ISGITLINK() test to reachable.c's
process_tree() function.  That fixed the first git-prune error, and
stopped it from trying to process the gitlink entries in trees as if
they were pointers to other trees (and of course failing, because
gitlinks _aren't_ trees).  That part of this patch is his.

The second area is add_cache_refs().  This is called before starting the
reachability analysis, and was calling lookup_blob() on every object
hash found in the index.  However, it is no longer true that every hash
in the index is a pointer to a blob, some of them are gitlinks, and are
not backed by any object at all, they are commits in another repository.
Normally this bug was not causing any problems, but in the case of the
self-referencing repository described above, it meant that the gitlink
hash was being marked as being of type OBJ_BLOB by add_cache_refs() call
to lookup_blob().  Then later, because that hash was also pointed to by
a ref, add_one_ref() would treat it as a commit; lookup_commit() would
return a NULL because that object was already noted as being an
OBJ_BLOB, not an OBJ_COMMIT; and parse_commit_buffer() would SEGFAULT on
that NULL pointer.

The fix made by this patch is to not blindly call lookup_blob() in
reachable.c's add_cache_refs(), and instead skip any index entries that
are S_ISGITLINK().

Signed-off-by: Andy Parkins &lt;andyparkins@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Initialize tree descriptors with a helper function rather than by hand.</title>
<updated>2007-03-21T17:21:57Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2007-03-21T17:08:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6fda5e5180c2e7c130978361aea53b4e66f36823'/>
<id>urn:sha1:6fda5e5180c2e7c130978361aea53b4e66f36823</id>
<content type='text'>
This removes slightly more lines than it adds, but the real reason for
doing this is that future optimizations will require more setup of the
tree descriptor, and so we want to do it in one place.

Also renamed the "desc.buf" field to "desc.buffer" just to trigger
compiler errors for old-style manual initializations, making sure I
didn't miss anything.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
</feed>
