<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/read-cache.c, branch v2.33.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.33.6</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.33.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-08-04T20:28:52Z</updated>
<entry>
<title>Merge branch 'ah/plugleaks'</title>
<updated>2021-08-04T20:28:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-08-04T20:28:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=31f9acf9ce29ae210b54997f7fb388a2dc543d53'/>
<id>urn:sha1:31f9acf9ce29ae210b54997f7fb388a2dc543d53</id>
<content type='text'>
Leak plugging.

* ah/plugleaks:
  reset: clear_unpack_trees_porcelain to plug leak
  builtin/rebase: fix options.strategy memory lifecycle
  builtin/merge: free found_ref when done
  builtin/mv: free or UNLEAK multiple pointers at end of cmd_mv
  convert: release strbuf to avoid leak
  read-cache: call diff_setup_done to avoid leak
  ref-filter: also free head for ATOM_HEAD to avoid leak
  diffcore-rename: move old_dir/new_dir definition to plug leak
  builtin/for-each-repo: remove unnecessary argv copy to plug leak
  builtin/submodule--helper: release unused strbuf to avoid leak
  environment: move strbuf into block to plug leak
  fmt-merge-msg: free newly allocated temporary strings when done
</content>
</entry>
<entry>
<title>Merge branch 'jt/bulk-prefetch'</title>
<updated>2021-08-02T21:06:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-08-02T21:06:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8230107f336b29d25111c517639b8cd5717c8416'/>
<id>urn:sha1:8230107f336b29d25111c517639b8cd5717c8416</id>
<content type='text'>
"git read-tree" had a codepath where blobs are fetched one-by-one
from the promisor remote, which has been corrected to fetch in bulk.

* jt/bulk-prefetch:
  cache-tree: prefetch in partial clone read-tree
  unpack-trees: refactor prefetching code
</content>
</entry>
<entry>
<title>Merge branch 'ds/status-with-sparse-index'</title>
<updated>2021-07-28T20:18:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-07-28T20:18:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b271a3034fc54a7c84ae5803d72f14a29b172c78'/>
<id>urn:sha1:b271a3034fc54a7c84ae5803d72f14a29b172c78</id>
<content type='text'>
"git status" codepath learned to work with sparsely populated index
without hydrating it fully.

* ds/status-with-sparse-index:
  t1092: document bad sparse-checkout behavior
  fsmonitor: integrate with sparse index
  wt-status: expand added sparse directory entries
  status: use sparse-index throughout
  status: skip sparse-checkout percentage with sparse-index
  diff-lib: handle index diffs with sparse dirs
  dir.c: accept a directory as part of cone-mode patterns
  unpack-trees: unpack sparse directory entries
  unpack-trees: rename unpack_nondirectories()
  unpack-trees: compare sparse directories correctly
  unpack-trees: preserve cache_bottom
  t1092: add tests for status/add and sparse files
  t1092: expand repository data shape
  t1092: replace incorrect 'echo' with 'cat'
  sparse-index: include EXTENDED flag when expanding
  sparse-index: skip indexes with unmerged entries
</content>
</entry>
<entry>
<title>read-cache: call diff_setup_done to avoid leak</title>
<updated>2021-07-26T19:19:20Z</updated>
<author>
<name>Andrzej Hunt</name>
<email>ajrhunt@google.com</email>
</author>
<published>2021-07-25T13:08:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d833e933719cd4badb7ec7d042d6f7cc206247d'/>
<id>urn:sha1:8d833e933719cd4badb7ec7d042d6f7cc206247d</id>
<content type='text'>
repo_diff_setup() calls through to diff.c's static prep_parse_options(),
which in  turn allocates a new array into diff_opts.parseopts.
diff_setup_done() is responsible for freeing that array, and has the
benefit of verifying diff_opts too - hence we add a call to
diff_setup_done() to avoid leaking parseopts.

Output from the leak as found while running t0090 with LSAN:

Direct leak of 7120 byte(s) in 1 object(s) allocated from:
    #0 0x49a82d in malloc ../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0xa8bf89 in do_xmalloc wrapper.c:41:8
    #2 0x7a7bae in prep_parse_options diff.c:5636:2
    #3 0x7a7bae in repo_diff_setup diff.c:4611:2
    #4 0x93716c in repo_index_has_changes read-cache.c:2518:3
    #5 0x872233 in unclean merge-ort-wrappers.c:12:14
    #6 0x872233 in merge_ort_recursive merge-ort-wrappers.c:53:6
    #7 0x5d5b11 in try_merge_strategy builtin/merge.c:752:12
    #8 0x5d0b6b in cmd_merge builtin/merge.c:1666:9
    #9 0x4ce83e in run_builtin git.c:475:11
    #10 0x4ccafe in handle_builtin git.c:729:3
    #11 0x4cb01c in run_argv git.c:818:4
    #12 0x4cb01c in cmd_main git.c:949:19
    #13 0x6bdc2d in main common-main.c:52:11
    #14 0x7f551eb51349 in __libc_start_main (/lib64/libc.so.6+0x24349)

SUMMARY: AddressSanitizer: 7120 byte(s) leaked in 1 allocation(s)

Signed-off-by: Andrzej Hunt &lt;andrzej@ahunt.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>unpack-trees: refactor prefetching code</title>
<updated>2021-07-23T21:21:57Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2021-07-23T18:52:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2896d27391afcbc990439e63972bb33693a7d6b'/>
<id>urn:sha1:b2896d27391afcbc990439e63972bb33693a7d6b</id>
<content type='text'>
Refactor the prefetching code in unpack-trees.c into its own function,
because it will be used elsewhere in a subsequent commit.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ew/mmap-failures'</title>
<updated>2021-07-17T00:42:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-07-17T00:42:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a93c6fd677f16285ce1109f9f200b2b235ab981e'/>
<id>urn:sha1:a93c6fd677f16285ce1109f9f200b2b235ab981e</id>
<content type='text'>
Error message update.

* ew/mmap-failures:
  xmmap: inform Linux users of tuning knobs on ENOMEM
</content>
</entry>
<entry>
<title>status: use sparse-index throughout</title>
<updated>2021-07-14T20:42:49Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-07-14T13:12:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d76723ee5313d0176e8777af4aa104d7562543c1'/>
<id>urn:sha1:d76723ee5313d0176e8777af4aa104d7562543c1</id>
<content type='text'>
By testing 'git -c core.fsmonitor= status -uno', we can check for the
simplest index operations that can be made sparse-aware. The necessary
implementation details are already integrated with sparse-checkout, so
modify command_requires_full_index to be zero for cmd_status().

In refresh_index(), we loop through the index entries to refresh their
stat() information. However, sparse directories have no stat()
information to populate. Ignore these entries.

This allows 'git status' to no longer expand a sparse index to a full
one. This is further tested by dropping the "-uno" option and adding an
untracked file into the worktree.

The performance test p2000-sparse-checkout-operations.sh demonstrates
these improvements:

Test                                  HEAD~1           HEAD
-----------------------------------------------------------------------------
2000.2: git status (full-index-v3)    0.31(0.30+0.05)  0.31(0.29+0.06) +0.0%
2000.3: git status (full-index-v4)    0.31(0.29+0.07)  0.34(0.30+0.08) +9.7%
2000.4: git status (sparse-index-v3)  2.35(2.28+0.10)  0.04(0.04+0.05) -98.3%
2000.5: git status (sparse-index-v4)  2.35(2.24+0.15)  0.05(0.04+0.06) -97.9%

Note that since HEAD~1 was expanding the sparse index by parsing trees,
it was artificially slower than the full index case. Thus, the 98%
improvement is misleading, and instead we should celebrate the 0.34s to
0.05s improvement of 85%. This is more indicative of the peformance
gains we are expecting by using a sparse index.

Note: we are dropping the assignment of core.fsmonitor here. This is not
necessary for the test script as we are not altering the config any
other way. Correct integration with FS Monitor will be validated in
later changes.

Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
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>Merge branch 'ab/progress-cleanup'</title>
<updated>2021-07-08T20:15:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-07-08T20:15:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2134c3fb1f51fd32f1e21c5c6925422cf8bf8891'/>
<id>urn:sha1:2134c3fb1f51fd32f1e21c5c6925422cf8bf8891</id>
<content type='text'>
Code clean-up.

* ab/progress-cleanup:
  read-cache.c: don't guard calls to progress.c API
</content>
</entry>
<entry>
<title>xmmap: inform Linux users of tuning knobs on ENOMEM</title>
<updated>2021-06-30T06:14:25Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2021-06-30T00:01:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc0592941138df684770bfe800ccad6b810214c3'/>
<id>urn:sha1:dc0592941138df684770bfe800ccad6b810214c3</id>
<content type='text'>
Linux users may benefit from additional information on how to
avoid ENOMEM from mmap despite the system having enough RAM to
accomodate them.  We can't reliably unmap pack windows to work
around the issue since malloc and other library routines may
mmap without our knowledge.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>read-cache.c: don't guard calls to progress.c API</title>
<updated>2021-06-08T01:09:13Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-06-07T14:43:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b7b793d1e7b1ec8104eef2da450ff47c02c9c365'/>
<id>urn:sha1:b7b793d1e7b1ec8104eef2da450ff47c02c9c365</id>
<content type='text'>
Don't guard the calls to the progress.c API with "if (progress)". The
API itself will check this. This doesn't change any behavior, but
makes this code consistent with the rest of the codebase.

See ae9af12287b (status: show progress bar if refreshing the index
takes too long, 2018-09-15) for the commit that added the pattern
we're changing here.

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