<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache-tree.h, branch v2.37.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.37.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.37.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-06-16T18:59:56Z</updated>
<entry>
<title>cache-tree: remove cache_tree_find_path()</title>
<updated>2022-06-16T18:59:56Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-06-16T13:13:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=86aa250aa871a4d8314f1f51ee007e93a9461e1e'/>
<id>urn:sha1:86aa250aa871a4d8314f1f51ee007e93a9461e1e</id>
<content type='text'>
This reverts 080ab56a46 (cache-tree: implement cache_tree_find_path(),
2022-05-23). The cache_tree_find_path() method was never actually called
in the topic that added it. I cannot find any reference to it in any of
my forks, so this appears to not be needed at the moment.

Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache-tree: implement cache_tree_find_path()</title>
<updated>2022-05-23T18:08:21Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2022-05-23T13:48:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=080ab56a46ad65068201a768a04464341117fe81'/>
<id>urn:sha1:080ab56a46ad65068201a768a04464341117fe81</id>
<content type='text'>
Given a 'struct cache_tree', it may be beneficial to navigate directly
to a node within that corresponds to a given path name. Create
cache_tree_find_path() for this function. It returns NULL when no such
path exists.

The implementation is adapted from do_invalidate_path() which does a
similar search but also modifies the nodes it finds along the way. The
method could be implemented simply using tail-recursion, but this while
loop does the same thing.

This new method is not currently used, but will be in an upcoming
change.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache-tree: extract subtree_pos()</title>
<updated>2021-01-24T01:14:07Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-01-23T19:58:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c80dd3967f28527dab49c8e9525524c7f33baa22'/>
<id>urn:sha1:c80dd3967f28527dab49c8e9525524c7f33baa22</id>
<content type='text'>
This method will be helpful to use outside of cache-tree.c in a later
feature. The implementation is subtle due to subtree_name_cmp() sorting
by length and then lexicographically.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache-tree: share code between functions writing an index as a tree</title>
<updated>2019-08-19T17:08:03Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2019-08-17T18:41:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=724dd767b245db588840d7e9dbd46687ee84020b'/>
<id>urn:sha1:724dd767b245db588840d7e9dbd46687ee84020b</id>
<content type='text'>
write_tree_from_memory() appeared to be a merge-recursive special that
basically duplicated write_index_as_tree().  The two have a different
signature, but the bigger difference was just that write_index_as_tree()
would always unconditionally read the index off of disk instead of
working on the current in-memory index.  So:

  * split out common code into write_index_as_tree_internal()

  * rename write_tree_from_memory() to write_inmemory_index_as_tree(),
    make it call write_index_as_tree_internal(), and move it to
    cache-tree.c

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>cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch</title>
<updated>2019-01-24T19:55:06Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-01-24T08:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8adbec9feaa7a1ab9814db1115826e87033712e'/>
<id>urn:sha1:f8adbec9feaa7a1ab9814db1115826e87033712e</id>
<content type='text'>
By default, index compat macros are off from now on, because they
could hide the_index dependency.

Only those in builtin can use it.

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>cache-tree.c: remove the_repository references</title>
<updated>2018-11-12T05:50:06Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-10T05:49:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c207e9e1f6dd1802f0deadae51af5615d855edc4'/>
<id>urn:sha1:c207e9e1f6dd1802f0deadae51af5615d855edc4</id>
<content type='text'>
This case is more interesting than other boring "remove the_repo"
commits because while we need access to the object database, we cannot
simply use r-&gt;index because unpack-trees.c can operate on a temporary
index, not $GIT_DIR/index. Ideally we should be able to pass an object
database to lookup_tree() but that ship has sailed.

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 'nd/unpack-trees-with-cache-tree'</title>
<updated>2018-09-17T20:53:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-17T20:53:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7e794d0a3f7ad4a37541539b823d5b9afdc10ce3'/>
<id>urn:sha1:7e794d0a3f7ad4a37541539b823d5b9afdc10ce3</id>
<content type='text'>
The unpack_trees() API used in checking out a branch and merging
walks one or more trees along with the index.  When the cache-tree
in the index tells us that we are walking a tree whose flattened
contents is known (i.e. matches a span in the index), as linearly
scanning a span in the index is much more efficient than having to
open tree objects recursively and listing their entries, the walk
can be optimized, which is done in this topic.

* nd/unpack-trees-with-cache-tree:
  Document update for nd/unpack-trees-with-cache-tree
  cache-tree: verify valid cache-tree in the test suite
  unpack-trees: add missing cache invalidation
  unpack-trees: reuse (still valid) cache-tree from src_index
  unpack-trees: reduce malloc in cache-tree walk
  unpack-trees: optimize walking same trees with cache-tree
  unpack-trees: add performance tracing
  trace.h: support nested performance tracing
</content>
</entry>
<entry>
<title>cache-tree: verify valid cache-tree in the test suite</title>
<updated>2018-08-18T16:47:46Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-08-18T14:41:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4592e6080ff0f9eb0218162be0e40b2d6abc979a'/>
<id>urn:sha1:4592e6080ff0f9eb0218162be0e40b2d6abc979a</id>
<content type='text'>
This makes sure that cache-tree is consistent with the index. The main
purpose is to catch potential problems by saving the index in
unpack_trees() but the line in write_index() would also help spot
missing invalidation in other code.

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>cache-tree: wrap the_index based wrappers with #ifdef</title>
<updated>2018-08-13T21:14:42Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-08-13T16:14:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=07096c969678a999c24816805d72bf7e0e840384'/>
<id>urn:sha1:07096c969678a999c24816805d72bf7e0e840384</id>
<content type='text'>
This puts update_main_cache_tree() and write_cache_as_tree() in the
same group of "index compat" functions that assume the_index
implicitly, which should only be used within builtin/ or t/helper.

sequencer.c is also updated to not use these functions. As of now, no
files outside builtin/ use these functions anymore.

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>cache-tree.h: drop extern from function declaration</title>
<updated>2018-08-03T17:42:54Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-06-30T09:20:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ab34f9e0586d4f7b73270bdd50f9a0be64514c1'/>
<id>urn:sha1:9ab34f9e0586d4f7b73270bdd50f9a0be64514c1</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>
</feed>
