<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.c, branch v2.17.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.17.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.17.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-05-22T05:25:26Z</updated>
<entry>
<title>Sync with Git 2.16.4</title>
<updated>2018-05-22T05:25:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-22T05:25:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=68f95b26e43f8183b9d1cdd41f42e99da43152bf'/>
<id>urn:sha1:68f95b26e43f8183b9d1cdd41f42e99da43152bf</id>
<content type='text'>
* maint-2.16:
  Git 2.16.4
  Git 2.15.2
  Git 2.14.4
  Git 2.13.7
  verify_path: disallow symlinks in .gitmodules
  update-index: stat updated files earlier
  verify_dotfile: mention case-insensitivity in comment
  verify_path: drop clever fallthrough
  skip_prefix: add case-insensitive variant
  is_{hfs,ntfs}_dotgitmodules: add tests
  is_ntfs_dotgit: match other .git files
  is_hfs_dotgit: match other .git files
  is_ntfs_dotgit: use a size_t for traversing string
  submodule-config: verify submodule names as paths
</content>
</entry>
<entry>
<title>Merge branch 'bp/untracked-cache-noflush'</title>
<updated>2018-03-08T20:36:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-03-08T20:36:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cdda65acae0b05a197c9f6684d517a5c4325c08f'/>
<id>urn:sha1:cdda65acae0b05a197c9f6684d517a5c4325c08f</id>
<content type='text'>
Writing out the index file when the only thing that changed in it
is the untracked cache information is often wasteful, and this has
been optimized out.

* bp/untracked-cache-noflush:
  untracked cache: use git_env_bool() not getenv() for customization
  dir.c: don't flag the index as dirty for changes to the untracked cache
</content>
</entry>
<entry>
<title>untracked cache: use git_env_bool() not getenv() for customization</title>
<updated>2018-02-28T21:27:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-28T21:21:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=026336cb277693c5a8cdfa4705a26daf0a754328'/>
<id>urn:sha1:026336cb277693c5a8cdfa4705a26daf0a754328</id>
<content type='text'>
GIT_DISABLE_UNTRACKED_CACHE and GIT_TEST_UNTRACKED_CACHE are only
sensed for their presense by using getenv(); use git_env_bool()
instead so that GIT_DISABLE_UNTRACKED_CACHE=false would work as
naïvely expected.

Also rename GIT_TEST_UNTRACKED_CACHE to GIT_FORCE_UNTRACKED_CACHE
to express what it does more honestly.  Forcing its use may be one
useful thing to do while testing the feature, but testing does not
have to be the only use of the knob.

While at it, avoid repeated calls to git_env_bool() by capturing the
return value from the first call in a static variable.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/fix-untracked-cache-invalidation'</title>
<updated>2018-02-27T18:33:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-27T18:33:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf44c1e0a2f5c8dc1a615659b0234a459b2148c2'/>
<id>urn:sha1:cf44c1e0a2f5c8dc1a615659b0234a459b2148c2</id>
<content type='text'>
Some bugs around "untracked cache" feature have been fixed.

* nd/fix-untracked-cache-invalidation:
  dir.c: ignore paths containing .git when invalidating untracked cache
  dir.c: stop ignoring opendir() error in open_cached_dir()
  dir.c: fix missing dir invalidation in untracked code
  dir.c: avoid stat() in valid_cached_dir()
  status: add a failing test showing a core.untrackedCache bug
</content>
</entry>
<entry>
<title>Merge branch 'nd/trace-index-ops'</title>
<updated>2018-02-15T22:55:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-15T22:55:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=090dbea6843f860de8c981d97d031621176fc2be'/>
<id>urn:sha1:090dbea6843f860de8c981d97d031621176fc2be</id>
<content type='text'>
* nd/trace-index-ops:
  trace: measure where the time is spent in the index-heavy operations
</content>
</entry>
<entry>
<title>Merge branch 'po/object-id'</title>
<updated>2018-02-15T22:55:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-15T22:55:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8be8342b4c47df386c6eced39922595d7dfdccc9'/>
<id>urn:sha1:8be8342b4c47df386c6eced39922595d7dfdccc9</id>
<content type='text'>
Conversion from uchar[20] to struct object_id continues.

* po/object-id:
  sha1_file: rename hash_sha1_file_literally
  sha1_file: convert write_loose_object to object_id
  sha1_file: convert force_object_loose to object_id
  sha1_file: convert write_sha1_file to object_id
  notes: convert write_notes_tree to object_id
  notes: convert combine_notes_* to object_id
  commit: convert commit_tree* to object_id
  match-trees: convert splice_tree to object_id
  cache: clear whole hash buffer with oidclr
  sha1_file: convert hash_sha1_file to object_id
  dir: convert struct sha1_stat to use object_id
  sha1_file: convert pretend_sha1_file to object_id
</content>
</entry>
<entry>
<title>dir.c: ignore paths containing .git when invalidating untracked cache</title>
<updated>2018-02-07T20:27:02Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-07T09:21:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0cacebf099dd6467845419f212acdcfe5f8d923f'/>
<id>urn:sha1:0cacebf099dd6467845419f212acdcfe5f8d923f</id>
<content type='text'>
read_directory() code ignores all paths named ".git" even if it's not
a valid git repository. See treat_path() for details. Since ".git" is
basically invisible to read_directory(), when we are asked to
invalidate a path that contains ".git", we can safely ignore it
because the slow path would not consider it anyway.

This helps when fsmonitor is used and we have a real ".git" repo at
worktree top. Occasionally .git/index will be updated and if the
fsmonitor hook does not filter it, untracked cache is asked to
invalidate the path ".git/index".

Without this patch, we invalidate the root directory unncessarily,
which:

- makes read_directory() fall back to slow path for root directory
  (slower)

- makes the index dirty (because UNTR extension is updated). Depending
  on the index size, writing it down could also be slow.

A note about the new "safe_path" knob. Since this new check could be
relatively expensive, avoid it when we know it's not needed. If the
path comes from the index, it can't contain ".git". If it does
contain, we may be screwed up at many more levels, not just this one.

Noticed-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
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>dir.c: don't flag the index as dirty for changes to the untracked cache</title>
<updated>2018-02-05T20:55:49Z</updated>
<author>
<name>Ben Peart</name>
<email>benpeart@microsoft.com</email>
</author>
<published>2018-02-05T19:56:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc9ecbeb93d3c4fae2439e1d9c5346052a1796c2'/>
<id>urn:sha1:fc9ecbeb93d3c4fae2439e1d9c5346052a1796c2</id>
<content type='text'>
The untracked cache saves its current state in the UNTR index extension.
Currently, _any_ change to that state causes the index to be flagged as dirty
and written out to disk.  Unfortunately, the cost to write out the index can
exceed the savings gained by using the untracked cache.  Since it is a cache
that can be updated from the current state of the working directory, there is
no functional requirement that the index be written out for every change to the
untracked cache.

Update the untracked cache logic so that it no longer forces the index to be
written to disk except in the case where the extension is being turned on or
off.  When some other git command requires the index to be written to disk, the
untracked cache will take advantage of that to save it's updated state as well.
This results in a performance win when looked at over common sequences of git
commands (ie such as a status followed by add, commit, etc).

After this patch, all the logic to track statistics for the untracked cache
could be removed as it is only used by debug tracing used to debug the untracked
cache.

Signed-off-by: Ben Peart &lt;benpeart@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace: measure where the time is spent in the index-heavy operations</title>
<updated>2018-02-02T19:20:16Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-01-27T12:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca54d9baa4a8e73141d4c963245ee6f09dcc994d'/>
<id>urn:sha1:ca54d9baa4a8e73141d4c963245ee6f09dcc994d</id>
<content type='text'>
All the known heavy code blocks are measured (except object database
access). This should help identify if an optimization is effective or
not. An unoptimized git-status would give something like below:

    0.001791141 s: read cache ...
    0.004011363 s: preload index
    0.000516161 s: refresh index
    0.003139257 s: git command: ... 'status' '--porcelain=2'
    0.006788129 s: diff-files
    0.002090267 s: diff-index
    0.001885735 s: initialize name hash
    0.032013138 s: read directory
    0.051781209 s: git command: './git' 'status'

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>dir.c: stop ignoring opendir() error in open_cached_dir()</title>
<updated>2018-02-02T18:16:23Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-01-24T09:30:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6731550749c7326f0dcf26211e7c2e55de00e28'/>
<id>urn:sha1:b6731550749c7326f0dcf26211e7c2e55de00e28</id>
<content type='text'>
A follow-up to the recently fixed bugs in the untracked
invalidation. If opendir() fails it should show a warning, perhaps
this should die, but if this ever happens the error is probably
recoverable for the user, and dying would just make things worse.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
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>
