<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/tree.h, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-03-20T23:09:26Z</updated>
<entry>
<title>tree.h API: simplify read_tree_recursive() signature</title>
<updated>2021-03-20T23:09:26Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-03-20T22:37:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47957485b3b731a7860e0554d2bd12c0dce1c75a'/>
<id>urn:sha1:47957485b3b731a7860e0554d2bd12c0dce1c75a</id>
<content type='text'>
Simplify the signature of read_tree_recursive() to omit the "base",
"baselen" and "stage" arguments. No callers of it use these parameters
for anything anymore.

The last function to call read_tree_recursive() with a non-"" path was
read_tree_recursive() itself, but that was changed in
ffd31f661d5 (Reimplement read_tree_recursive() using
tree_entry_interesting(), 2011-03-25).

The last user of the "stage" parameter went away in the last commit,
and even that use was mere boilerplate.

So let's remove those and rename the read_tree_recursive() function to
just read_tree(). We had another read_tree() function that I've
refactored away in preceding commits, since all in-tree users read
trees recursively with a callback we can change the name to signify
that this is the norm.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree.h API: expose read_tree_1() as read_tree_at()</title>
<updated>2021-03-20T23:09:26Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-03-20T22:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6c9fc42e9f1bf27a3830ef594b7f5f9147af8361'/>
<id>urn:sha1:6c9fc42e9f1bf27a3830ef594b7f5f9147af8361</id>
<content type='text'>
Rename the static read_tree_1() function to read_tree_at(). This
function works just like read_tree_recursive(), except you provide
your own strbuf.

This step doesn't make much sense now, but in follow-up commits I'll
remove the base/baselen/stage arguments to read_tree_recursive(). At
that point an anticipated in-tree user[1] for the old
read_tree_recursive() couldn't provide a path to start the
traversal.

Let's give them a function to do so with an API that makes more sense
for them, by taking a strbuf we should be able to avoid more casting
and/or reallocations in the future.

1. https://lore.kernel.org/git/xmqqft106sok.fsf@gitster.g

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree.c API: move read_tree() into builtin/ls-files.c</title>
<updated>2021-03-20T23:09:25Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-03-20T22:37:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eefadd18e10fc0c4c808faa8ee077f375f28050c'/>
<id>urn:sha1:eefadd18e10fc0c4c808faa8ee077f375f28050c</id>
<content type='text'>
Since the read_tree() API was added around the same time as
read_tree_recursive() in 94537c78a82 (Move "read_tree()" to
"tree.c"[...], 2005-04-22) and b12ec373b8e ([PATCH] Teach read-tree
about commit objects, 2005-04-20) things have gradually migrated over
to the read_tree_recursive() version.

Now builtin/ls-files.c is the last user of this code, let's move all
the relevant code there. This allows for subsequent simplification of
it, and an eventual move to read_tree_recursive().

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree: enable cmp_cache_name_compare() to be used elsewhere</title>
<updated>2020-12-13T22:18:20Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2020-12-13T08:04:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=70912f66de751b2f1af145887dc64c9c0d06de36'/>
<id>urn:sha1:70912f66de751b2f1af145887dc64c9c0d06de36</id>
<content type='text'>
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree.c: make read_tree*() take 'struct repository *'</title>
<updated>2018-11-19T01:50:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-18T16:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e092073d643b17c82d72cf692fbfaea9c9796f11'/>
<id>urn:sha1:e092073d643b17c82d72cf692fbfaea9c9796f11</id>
<content type='text'>
These functions call tree_entry_interesting() which will soon require
a 'struct index_state *' to be passed in. Instead of just changing the
function signature to take an index, update to take a repo instead
because these functions do need object database access.

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>tree: allow lookup_tree to handle arbitrary repositories</title>
<updated>2018-06-29T17:43:39Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-29T01:22:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f58a6cb60222d32063437ae85859e6e7ac7ffc8e'/>
<id>urn:sha1:f58a6cb60222d32063437ae85859e6e7ac7ffc8e</id>
<content type='text'>
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree: add repository argument to lookup_tree</title>
<updated>2018-06-29T17:43:38Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-29T01:21:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f86bcc7b2ce6cad68ba1a48a528e380c6126705e'/>
<id>urn:sha1:f86bcc7b2ce6cad68ba1a48a528e380c6126705e</id>
<content type='text'>
Add a repository argument to allow the callers of lookup_tree
to be more specific about which repository to act on. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.

As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree: convert read_tree_recursive to struct object_id</title>
<updated>2018-03-14T16:23:47Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-03-12T02:27:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df46d77e00e7bbcfe46cc06c071fa5284f96c327'/>
<id>urn:sha1:df46d77e00e7bbcfe46cc06c071fa5284f96c327</id>
<content type='text'>
Convert the callback functions for read_tree_recursive to take a pointer
to struct object_id.

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>tree: convert read_tree to take an index parameter</title>
<updated>2017-06-13T18:40:51Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-06-12T22:13:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=85ab50f938601cf874c841cee4c56f1d1dc8199e'/>
<id>urn:sha1:85ab50f938601cf874c841cee4c56f1d1dc8199e</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree: convert parse_tree_indirect to struct object_id</title>
<updated>2017-05-08T06:12:58Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-05-06T22:10:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a9dbc179100b7119cb44eb5b4adcb47967f346a6'/>
<id>urn:sha1:a9dbc179100b7119cb44eb5b4adcb47967f346a6</id>
<content type='text'>
Convert parse_tree_indirect to take a pointer to struct object_id.
Update all the callers.  This transformation was achieved using the
following semantic patch and manual updates to the declaration and
definition.  Update builtin/checkout.c manually as well, since it uses a
ternary expression not handled by the semantic patch.

@@
expression E1;
@@
- parse_tree_indirect(E1.hash)
+ parse_tree_indirect(&amp;E1)

@@
expression E1;
@@
- parse_tree_indirect(E1-&gt;hash)
+ parse_tree_indirect(E1)

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
