<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/tree.c, branch v2.34.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.34.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.34.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>object: drop parsed_object_pool-&gt;commit_count</title>
<updated>2020-06-17T21:37:14Z</updated>
<author>
<name>Abhishek Kumar</name>
<email>abhishekkumar8222@gmail.com</email>
</author>
<published>2020-06-17T09:14:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6da43d937ca96d277556fa92c5a664fb1cbcc8ac'/>
<id>urn:sha1:6da43d937ca96d277556fa92c5a664fb1cbcc8ac</id>
<content type='text'>
14ba97f8 (alloc: allow arbitrary repositories for alloc functions,
2018-05-15) introduced parsed_object_pool-&gt;commit_count to keep count of
commits per repository and was used to assign commit-&gt;index.

However, commit-slab code requires commit-&gt;index values to be unique
and a global count would be correct, rather than a per-repo count.

Let's introduce a static counter variable, `parsed_commits_count` to
keep track of parsed commits so far.

As commit_count has no use anymore, let's also drop it from the struct.

Signed-off-by: Abhishek Kumar &lt;abhishekkumar8222@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree: simplify parse_tree_indirect()</title>
<updated>2019-09-03T22:10:53Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2019-08-29T19:06:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1577dc0f7c1326ce59e1e97fad8a0b1e8c826203'/>
<id>urn:sha1:1577dc0f7c1326ce59e1e97fad8a0b1e8c826203</id>
<content type='text'>
Reduce code duplication by turning parse_tree_indirect() into a wrapper
of repo_peel_to_type().  This avoids a segfault when handling a broken
tag where -&gt;tagged is NULL.  The new version also checks the return
value of parse_object() that was ignored by the old one.

Initial-patch-by: Stefan Sperling &lt;stsp@stsp.name&gt;
Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object: convert create_object() to use object_id</title>
<updated>2019-06-20T17:20:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-06-20T07:41:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a378509e1c8d817b3abe42bd8b3c8aa2a6f9af8a'/>
<id>urn:sha1:a378509e1c8d817b3abe42bd8b3c8aa2a6f9af8a</id>
<content type='text'>
There are no callers left of create_object() that aren't just passing us
the "hash" member of a "struct object_id". Let's take the whole struct,
which gets us closer to removing all raw sha1 variables.

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>object: convert lookup_object() to use object_id</title>
<updated>2019-06-20T17:18:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-06-20T07:41:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d0229abd93e1115d935b0e55067e29bcc9815ce8'/>
<id>urn:sha1:d0229abd93e1115d935b0e55067e29bcc9815ce8</id>
<content type='text'>
There are no callers left of lookup_object() that aren't just passing us
the "hash" member of a "struct object_id". Let's take the whole struct,
which gets us closer to removing all raw sha1 variables.  It also
matches the existing conversions of lookup_blob(), etc.

The conversions of callers were done by hand, but they're all mechanical
one-liners.

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/the-index-final'</title>
<updated>2019-02-07T06:05:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-02-07T06:05:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7589e63648bf5224e186990931b1491f36e10a4b'/>
<id>urn:sha1:7589e63648bf5224e186990931b1491f36e10a4b</id>
<content type='text'>
The assumption to work on the single "in-core index" instance has
been reduced from the library-ish part of the codebase.

* nd/the-index-final:
  cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch
  read-cache.c: remove the_* from index_has_changes()
  merge-recursive.c: remove implicit dependency on the_repository
  merge-recursive.c: remove implicit dependency on the_index
  sha1-name.c: remove implicit dependency on the_index
  read-cache.c: replace update_index_if_able with repo_&amp;
  read-cache.c: kill read_index()
  checkout: avoid the_index when possible
  repository.c: replace hold_locked_index() with repo_hold_locked_index()
  notes-utils.c: remove the_repository references
  grep: use grep_opt-&gt;repo instead of explict repo argument
</content>
</entry>
<entry>
<title>Merge branch 'bc/tree-walk-oid'</title>
<updated>2019-01-29T20:47:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-01-29T20:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=371820d5f1bb3c3e691ad21cee652c02c36ea758'/>
<id>urn:sha1:371820d5f1bb3c3e691ad21cee652c02c36ea758</id>
<content type='text'>
The code to walk tree objects has been taught that we may be
working with object names that are not computed with SHA-1.

* bc/tree-walk-oid:
  cache: make oidcpy always copy GIT_MAX_RAWSZ bytes
  tree-walk: store object_id in a separate member
  match-trees: use hashcpy to splice trees
  match-trees: compute buffer offset correctly when splicing
  tree-walk: copy object ID before use
</content>
</entry>
</feed>
