<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache-tree.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-02-22T22:55:44Z</updated>
<entry>
<title>Merge branch 'rs/cache-tree-strbuf-growth-fix'</title>
<updated>2023-02-22T22:55:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-02-22T22:55:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a42d69ee5beacd163229e5dd8c94be85431d6c85'/>
<id>urn:sha1:a42d69ee5beacd163229e5dd8c94be85431d6c85</id>
<content type='text'>
Remove unnecessary explicit sizing of strbuf.

* rs/cache-tree-strbuf-growth-fix:
  cache-tree: fix strbuf growth in prime_cache_tree_rec()
</content>
</entry>
<entry>
<title>cache-tree: fix strbuf growth in prime_cache_tree_rec()</title>
<updated>2023-02-10T20:24:12Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-02-10T20:20:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=93ea118bedf3f6d300520718250bf64d0e09a4ec'/>
<id>urn:sha1:93ea118bedf3f6d300520718250bf64d0e09a4ec</id>
<content type='text'>
Use size_t to store the original length of the strbuf tree_len, as
that's the correct type.

Don't double the allocated size of the strbuf when adding a subdirectory
name.  And the chance of the trailing slash fitting in the slack left by
strbuf_add() is very high, so stop pre-growing the strbuf at all.

Suggested-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&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>*: fix typos which duplicate a word</title>
<updated>2023-01-08T01:28:34Z</updated>
<author>
<name>Andrei Rybak</name>
<email>rybak.a.v@gmail.com</email>
</author>
<published>2023-01-07T13:56:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b39a84185e79cff69f9f1f79f1edb014ef27b9c6'/>
<id>urn:sha1:b39a84185e79cff69f9f1f79f1edb014ef27b9c6</id>
<content type='text'>
Fix typos in code comments which repeat various words.  Most of the
cases are simple in that they repeat a word that usually cannot be
repeated in a grammatically correct sentence.  Just remove the
incorrectly duplicated word in these cases and rewrap text, if needed.

A tricky case is usage of "that that", which is sometimes grammatically
correct.  However, an instance of this in "t7527-builtin-fsmonitor.sh"
doesn't need two words "that", because there is only one daemon being
discussed, so replace the second "that" with "the".

Reword code comment "entries exist on on-disk index" in function
update_one in file cache-tree.c, by replacing incorrect preposition "on"
with "in".

Signed-off-by: Andrei Rybak &lt;rybak.a.v@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>verify_one_sparse(): drop unused parameters</title>
<updated>2022-08-20T21:14:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-08-20T09:02:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5db8e59cf10bdf5b3a8d4b7cf5c20ee912c2a63a'/>
<id>urn:sha1:5db8e59cf10bdf5b3a8d4b7cf5c20ee912c2a63a</id>
<content type='text'>
This function has never used its repository or cache_tree parameters
since it was introduced in 9ad2d5ea71 (sparse-index: loose integration
with cache_tree_verify(), 2021-03-30).

As that commit notes, it may eventually be extended further, and that
might require looking at more data. But we can easily add them back if
necessary (and the repository is even included in the index_state these
days already). In the mean time, dropping them makes the code shorter
and appeases -Wunused-parameter.

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>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>Merge branch 'ab/bug-if-bug'</title>
<updated>2022-06-10T22:04:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-06-10T22:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4da14b574f2e52eb05e4fef7ed169a8f9e3a8b67'/>
<id>urn:sha1:4da14b574f2e52eb05e4fef7ed169a8f9e3a8b67</id>
<content type='text'>
A new bug() and BUG_if_bug() API is introduced to make it easier to
uniformly log "detect multiple bugs and abort in the end" pattern.

* ab/bug-if-bug:
  cache-tree.c: use bug() and BUG_if_bug()
  receive-pack: use bug() and BUG_if_bug()
  parse-options.c: use optbug() instead of BUG() "opts" check
  parse-options.c: use new bug() API for optbug()
  usage.c: add a non-fatal bug() function to go with BUG()
  common-main.c: move non-trace2 exit() behavior out of trace2.c
</content>
</entry>
<entry>
<title>Merge branch 'ds/sparse-sparse-checkout'</title>
<updated>2022-06-03T21:30:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-06-03T21:30:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c276c21da6d055060b1c216de1b1c04fb058425f'/>
<id>urn:sha1:c276c21da6d055060b1c216de1b1c04fb058425f</id>
<content type='text'>
"sparse-checkout" learns to work well with the sparse-index
feature.

* ds/sparse-sparse-checkout:
  sparse-checkout: integrate with sparse index
  p2000: add test for 'git sparse-checkout [add|set]'
  sparse-index: complete partial expansion
  sparse-index: partially expand directories
  sparse-checkout: --no-sparse-index needs a full index
  cache-tree: implement cache_tree_find_path()
  sparse-index: introduce partially-sparse indexes
  sparse-index: create expand_index()
  t1092: stress test 'git sparse-checkout set'
  t1092: refactor 'sparse-index contents' test
</content>
</entry>
<entry>
<title>Merge branch 'ns/batch-fsync'</title>
<updated>2022-06-03T21:30:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-06-03T21:30:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=83937e9592832408670da38bfe6e96c90ad63521'/>
<id>urn:sha1:83937e9592832408670da38bfe6e96c90ad63521</id>
<content type='text'>
Introduce a filesystem-dependent mechanism to optimize the way the
bits for many loose object files are ensured to hit the disk
platter.

* ns/batch-fsync:
  core.fsyncmethod: performance tests for batch mode
  t/perf: add iteration setup mechanism to perf-lib
  core.fsyncmethod: tests for batch mode
  test-lib-functions: add parsing helpers for ls-files and ls-tree
  core.fsync: use batch mode and sync loose objects by default on Windows
  unpack-objects: use the bulk-checkin infrastructure
  update-index: use the bulk-checkin infrastructure
  builtin/add: add ODB transaction around add_files_to_cache
  cache-tree: use ODB transaction around writing a tree
  core.fsyncmethod: batched disk flushes for loose-objects
  bulk-checkin: rebrand plug/unplug APIs as 'odb transactions'
  bulk-checkin: rename 'state' variable and separate 'plugged' boolean
</content>
</entry>
<entry>
<title>cache-tree.c: use bug() and BUG_if_bug()</title>
<updated>2022-06-02T19:55:16Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-02T12:25:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d40f0ad15e72daab6524988c9c4b4a3460488f8'/>
<id>urn:sha1:6d40f0ad15e72daab6524988c9c4b4a3460488f8</id>
<content type='text'>
Change "BUG" output originally added in a97e4075a16 (Keep
rename/rename conflicts of intermediate merges while doing recursive
merge, 2007-03-31), and later made to say it was a "BUG" in
19c6a4f8369 (merge-recursive: do not return NULL only to cause
segfault, 2010-01-21) to use the new bug() function.

This gets the same job done with slightly less code, as we won't need
to prefix lines with "BUG: ". More importantly we'll now log the full
set of messages via trace2, before this we'd only log the one BUG()
invocation.

We don't replace the last "BUG()" invocation with "BUG_if_bug()", as
in this case we're sure that we called bug() earlier, so there's no
need to make it a conditional.

While we're at it let's replace "There" with "there" in the message,
i.e. not start a message with a capital letter, per the
CodingGuidelines.

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>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>
</feed>
