<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/preload-index.c, branch v2.14.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.14.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.14.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-02-10T22:44:18Z</updated>
<entry>
<title>preload-index: avoid lstat for skip-worktree items</title>
<updated>2017-02-10T22:44:18Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2017-02-10T15:10:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e596acc23a8c92784349da613502626d758215b2'/>
<id>urn:sha1:e596acc23a8c92784349da613502626d758215b2</id>
<content type='text'>
Teach preload-index to avoid lstat() calls for index-entries
with skip-worktree bit set.  This is a performance optimization.

During a sparse-checkout, the skip-worktree bit is set on items
that were not populated and therefore are not present in the
worktree.  The per-thread preload-index loop performs a series
of tests on each index-entry as it attempts to compare the
worktree version with the index and mark them up-to-date.
This patch short-cuts that work.

On a Windows 10 system with a very large repo (450MB index)
and various levels of sparseness, performance was improved
in the {preloadindex=true, fscache=false} case by 80% and
in the {preloadindex=true, fscache=true} case by 20% for various
commands.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache.h: rename cache_def_free to cache_def_clear</title>
<updated>2014-07-13T17:12:37Z</updated>
<author>
<name>Karsten Blees</name>
<email>karsten.blees@gmail.com</email>
</author>
<published>2014-07-11T23:02:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2a608391509dc5ea50c9b88e5b98dae6694d7011'/>
<id>urn:sha1:2a608391509dc5ea50c9b88e5b98dae6694d7011</id>
<content type='text'>
Rename cache_def_free to cache_def_clear as it doesn't free the struct
cache_def, but just clears its content.

Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>symlinks: remove PATH_MAX limitation</title>
<updated>2014-07-07T18:22:42Z</updated>
<author>
<name>Karsten Blees</name>
<email>karsten.blees@gmail.com</email>
</author>
<published>2014-07-04T22:41:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e7c730530065fb2f366ecbcb1e71d7f7346b6a25'/>
<id>urn:sha1:e7c730530065fb2f366ecbcb1e71d7f7346b6a25</id>
<content type='text'>
'git checkout' fails if a directory is longer than PATH_MAX, because the
lstat_cache in symlinks.c checks if the leading directory exists using
PATH_MAX-bounded string operations.

Remove the limitation by using strbuf instead.

Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: convert some match_pathspec_depth() to ce_path_match()</title>
<updated>2014-02-24T22:36:52Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-01-24T13:40:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=429bb40abdb5b42ffdde5b1a58f9a37da723d179'/>
<id>urn:sha1:429bb40abdb5b42ffdde5b1a58f9a37da723d179</id>
<content type='text'>
This helps reduce the number of match_pathspec_depth() call sites and
show how match_pathspec_depth() is used.

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>convert read_cache_preload() to take struct pathspec</title>
<updated>2013-07-15T17:56:08Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:35:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ab2a2dabd6e13cd6830ff4f12f232dc79278e29'/>
<id>urn:sha1:5ab2a2dabd6e13cd6830ff4f12f232dc79278e29</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>
<entry>
<title>move struct pathspec and related functions to pathspec.[ch]</title>
<updated>2013-07-15T17:56:06Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:35:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64acde94efd2906c3e20560c31c2957ac0b242c4'/>
<id>urn:sha1:64acde94efd2906c3e20560c31c2957ac0b242c4</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>
<entry>
<title>Convert ce_path_match() to use struct pathspec</title>
<updated>2011-02-03T22:08:30Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2010-12-17T12:43:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb9cb55b944796374402ab4e2639300dc9b0b409'/>
<id>urn:sha1:eb9cb55b944796374402ab4e2639300dc9b0b409</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>
<entry>
<title>Make ce_uptodate() trustworthy again</title>
<updated>2010-01-24T08:15:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-01-24T08:10:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=125fd98434ce773de45c4a40927c222ec5c43ae1'/>
<id>urn:sha1:125fd98434ce773de45c4a40927c222ec5c43ae1</id>
<content type='text'>
The rule has always been that a cache entry that is ce_uptodate(ce)
means that we already have checked the work tree entity and we know
there is no change in the work tree compared to the index, and nobody
should have to double check.  Note that false ce_uptodate(ce) does not
mean it is known to be dirty---it only means we don't know if it is
clean.

There are a few codepaths (refresh-index and preload-index are among
them) that mark a cache entry as up-to-date based solely on the return
value from ie_match_stat(); this function uses lstat() to see if the
work tree entity has been touched, and for a submodule entry, if its
HEAD points at the same commit as the commit recorded in the index of
the superproject (a submodule that is not even cloned is considered
clean).

A submodule is no longer considered unmodified merely because its HEAD
matches the index of the superproject these days, in order to prevent
people from forgetting to commit in the submodule and updating the
superproject index with the new submodule commit, before commiting the
state in the superproject.  However, the patch to do so didn't update
the codepath that marks cache entries up-to-date based on the updated
definition and instead worked it around by saying "we don't trust the
return value of ce_uptodate() for submodules."

This makes ce_uptodate() trustworthy again by not marking submodule
entries up-to-date.

The next step _could_ be to introduce a few "in-core" flag bits to
cache_entry structure to record "this entry is _known_ to be dirty",
call is_submodule_modified() from ie_match_stat(), and use these new
bits to avoid running this rather expensive check more than once, but
that can be a separate patch.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>janitor: add DIV_ROUND_UP and use it.</title>
<updated>2009-07-23T04:57:41Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2009-07-22T21:34:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98cb6f30f708ef416572bf65bd26ac9f998ae0dc'/>
<id>urn:sha1:98cb6f30f708ef416572bf65bd26ac9f998ae0dc</id>
<content type='text'>
Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Make index preloading check the whole path to the file</title>
<updated>2009-07-10T05:38:34Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-07-09T20:37:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f62ce3de9dd4803f50f65e17f5fc03c7bdb49c40'/>
<id>urn:sha1:f62ce3de9dd4803f50f65e17f5fc03c7bdb49c40</id>
<content type='text'>
This uses the new thread-safe 'threaded_has_symlink_leading_path()'
function to efficiently verify that the whole path leading up to the
filename is a proper path, and does not contain symlinks.

This makes 'ce_uptodate()' a much stronger guarantee: it no longer just
guarantees that the 'lstat()' of the path would match, it also means
that we know that people haven't played games with moving directories
around and covered it up with symlinks.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
