<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/tree.h, branch v2.3.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.7</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-12-01T19:32:29Z</updated>
<entry>
<title>tree.c: update read_tree_recursive callback to pass strbuf as base</title>
<updated>2014-12-01T19:32:29Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-11-30T09:05:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a0b0b6de996e2ac7eeb951e3d08f577c11c7e54'/>
<id>urn:sha1:6a0b0b6de996e2ac7eeb951e3d08f577c11c7e54</id>
<content type='text'>
This allows the callback to use 'base' as a temporary buffer to
quickly assemble full path "without" extra allocation. The callback
has to restore it afterwards of course.

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
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 'jk/free-tree-buffer'</title>
<updated>2013-09-17T18:37:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-17T18:37:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b8f23112f0415cc86eb0ec576ac7e16c7c9d78b8'/>
<id>urn:sha1:b8f23112f0415cc86eb0ec576ac7e16c7c9d78b8</id>
<content type='text'>
* jk/free-tree-buffer:
  clear parsed flag when we free tree buffers
</content>
</entry>
<entry>
<title>checkout: convert read_tree_some to take struct pathspec</title>
<updated>2013-07-15T17:56:08Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:35:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18e4f4059936dd35dfe929f502101ca371af856c'/>
<id>urn:sha1:18e4f4059936dd35dfe929f502101ca371af856c</id>
<content type='text'>
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>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>Convert read_tree{,_recursive} to support struct pathspec</title>
<updated>2011-03-25T16:20:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2011-03-25T09:34:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f0096c06bcdeb7aa6ae8a749ddc9d6d4a2c381d1'/>
<id>urn:sha1:f0096c06bcdeb7aa6ae8a749ddc9d6d4a2c381d1</id>
<content type='text'>
This patch changes behavior of the two functions. Previously it does
prefix matching only. Now it can also do wildcard matching.

All callers are updated. Some gain wildcard matching (archive,
checkout), others reset pathspec_item.has_wildcard to retain old
behavior (ls-files, ls-tree as they are plumbing).

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>add context pointer to read_tree_recursive()</title>
<updated>2008-07-15T14:17:59Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2008-07-14T19:22:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=671f0707212c929533dc6ec9e032faee328e4602'/>
<id>urn:sha1:671f0707212c929533dc6ec9e032faee328e4602</id>
<content type='text'>
Add a pointer parameter to read_tree_recursive(), which is passed to the
callback function.  This allows callers of read_tree_recursive() to
share data with the callback without resorting to global variables.  All
current callers pass NULL.

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Remove last vestiges of generic tree_entry_list</title>
<updated>2006-05-30T02:08:37Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2006-05-29T19:21:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15b5536ee47c6684806edd7725adbbdede9fb95c'/>
<id>urn:sha1:15b5536ee47c6684806edd7725adbbdede9fb95c</id>
<content type='text'>
The old tree_entry_list is dead, long live the unified single tree
parser.

Yes, we now still have a compatibility function to create a bogus
tree_entry_list in builtin-read-tree.c, but that is now entirely local
to that very messy piece of code.

I'd love to clean read-tree.c up too, but I'm too scared right now, so
the best I can do is to just contain the damage, and try to make sure
that no new users of the tree_entry_list sprout up by not having it as
an exported interface any more.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Remove unused "zeropad" entry from tree_list_entry</title>
<updated>2006-05-30T02:08:25Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2006-05-29T19:19:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3bc1eca91e5230739cfb488e63fae35a166a07de'/>
<id>urn:sha1:3bc1eca91e5230739cfb488e63fae35a166a07de</id>
<content type='text'>
That was a hack, only needed because 'git fsck-objects' didn't look at
the raw tree format.  Now that fsck traverses the tree itself, we can
drop it.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Remove "tree-&gt;entries" tree-entry list from tree parser</title>
<updated>2006-05-30T02:06:59Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2006-05-29T19:18:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d9c58c69d1bab601e67b036d0546e85abcee7eb'/>
<id>urn:sha1:2d9c58c69d1bab601e67b036d0546e85abcee7eb</id>
<content type='text'>
Instead, just use the tree buffer directly, and use the tree-walk
infrastructure to walk the buffers instead of the tree-entry list.

The tree-entry list is inefficient, and generates tons of small
allocations for no good reason. The tree-walk infrastructure is
generally no harder to use than following a linked list, and allows
us to do most tree parsing in-place.

Some programs still use the old tree-entry lists, and are a bit
painful to convert without major surgery. For them we have a helper
function that creates a temporary tree-entry list on demand.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Make "tree_entry" have a SHA1 instead of a union of object pointers</title>
<updated>2006-05-30T02:05:06Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2006-05-29T19:16:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a7c352bd0ecac4b4c96c0995d61de9ef8d814f9'/>
<id>urn:sha1:3a7c352bd0ecac4b4c96c0995d61de9ef8d814f9</id>
<content type='text'>
This is preparatory work for further cleanups, where we try to make
tree_entry look more like the more efficient tree-walk descriptor.

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