<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.h, 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-02-27T18:33:50Z</updated>
<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>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: convert struct sha1_stat to use object_id</title>
<updated>2018-01-30T18:42:36Z</updated>
<author>
<name>Patryk Obara</name>
<email>patryk.obara@gmail.com</email>
</author>
<published>2018-01-28T00:13:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4b33e60201c12f3a68441807444e3726853a3960'/>
<id>urn:sha1:4b33e60201c12f3a68441807444e3726853a3960</id>
<content type='text'>
Convert the declaration of struct sha1_stat. Adjust all usages of this
struct and replace hash{clr,cmp,cpy} with oid{clr,cmp,cpy} wherever
possible.  Rename it to struct oid_stat.

Rename static function load_sha1_stat to load_oid_stat.

Remove macro EMPTY_BLOB_SHA1_BIN, as it's no longer used.

Signed-off-by: Patryk Obara &lt;patryk.obara@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jh/object-filtering'</title>
<updated>2017-12-27T19:16:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-12-27T19:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=61061abba7d60f555e97a22ab5775a9d53db1660'/>
<id>urn:sha1:61061abba7d60f555e97a22ab5775a9d53db1660</id>
<content type='text'>
In preparation for implementing narrow/partial clone, the object
walking machinery has been taught a way to tell it to "filter" some
objects from enumeration.

* jh/object-filtering:
  rev-list: support --no-filter argument
  list-objects-filter-options: support --no-filter
  list-objects-filter-options: fix 'keword' typo in comment
  pack-objects: add list-objects filtering
  rev-list: add list-objects filtering support
  list-objects: filter objects in traverse_commit_list
  oidset: add iterator methods to oidset
  oidmap: add oidmap iterator methods
  dir: allow exclusions from blob in addition to file
</content>
</entry>
<entry>
<title>dir: allow exclusions from blob in addition to file</title>
<updated>2017-11-22T05:11:56Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2017-11-21T20:58:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=578d81d0c445f714dce46d5f4e3f599ac3a94c75'/>
<id>urn:sha1:578d81d0c445f714dce46d5f4e3f599ac3a94c75</id>
<content type='text'>
Refactor add_excludes() to separate the reading of the
exclude file into a buffer and the parsing of the buffer
into exclude_list items.

Add add_excludes_from_blob_to_list() to allow an exclude
file be specified with an OID without assuming a local
worktree or index exists.

Refactor read_skip_worktree_file_from_index() and add
do_read_blob() to eliminate duplication of preliminary
processing of blob contents.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Reviewed-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 'bp/fsmonitor'</title>
<updated>2017-11-21T05:07:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-21T05:07:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e05336bddacb90cf243aacc0f7b7f34f900453d7'/>
<id>urn:sha1:e05336bddacb90cf243aacc0f7b7f34f900453d7</id>
<content type='text'>
We learned to talk to watchman to speed up "git status" and other
operations that need to see which paths have been modified.

* bp/fsmonitor:
  fsmonitor: preserve utf8 filenames in fsmonitor-watchman log
  fsmonitor: read entirety of watchman output
  fsmonitor: MINGW support for watchman integration
  fsmonitor: add a performance test
  fsmonitor: add a sample integration script for Watchman
  fsmonitor: add test cases for fsmonitor extension
  split-index: disable the fsmonitor extension when running the split index test
  fsmonitor: add a test tool to dump the index extension
  update-index: add fsmonitor support to update-index
  ls-files: Add support in ls-files to display the fsmonitor valid bit
  fsmonitor: add documentation for the fsmonitor extension.
  fsmonitor: teach git to optionally utilize a file system monitor to speed up detecting new or changed files.
  update-index: add a new --force-write-index option
  preload-index: add override to enable testing preload-index
  bswap: add 64 bit endianness helper get_be64
</content>
</entry>
<entry>
<title>status: add option to show ignored files differently</title>
<updated>2017-10-31T02:54:21Z</updated>
<author>
<name>Jameson Miller</name>
<email>jamill@microsoft.com</email>
</author>
<published>2017-10-30T17:21:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eec0f7f2b7532f4ec74461f969701911b8876162'/>
<id>urn:sha1:eec0f7f2b7532f4ec74461f969701911b8876162</id>
<content type='text'>
Teach the status command more flexibility in how ignored files are
reported. Currently, the reporting of ignored files and untracked
files are linked. You cannot control how ignored files are reported
independently of how untracked files are reported (i.e. `all` vs
`normal`). This makes it impossible to show untracked files with the
`all` option, but show ignored files with the `normal` option.

This work 1) adds the ability to control the reporting of ignored
files independently of untracked files and 2) introduces the concept
of status reporting ignored paths that explicitly match an ignored
pattern. There are 2 benefits to these changes: 1) if a consumer needs
all untracked files but not all ignored files, there is a performance
benefit to not scanning all contents of an ignored directory and 2)
returning ignored files that explicitly match a path allow a consumer
to make more informed decisions about when a status result might be
stale.

This commit implements --ignored=matching with --untracked-files=all.
The following commit will implement --ignored=matching with
--untracked=files=normal.

As an example of where this flexibility could be useful is that our
application (Visual Studio) runs the status command and presents the
output. It shows all untracked files individually (e.g. using the
'--untracked-files==all' option), and would like to know about which
paths are ignored. It uses information about ignored paths to make
decisions about when the status result might have changed.
Additionally, many projects place build output into directories inside
a repository's working directory (e.g. in "bin/" and "obj/"
directories). Normal usage is to explicitly ignore these 2 directory
names in the .gitignore file (rather than or in addition to the *.obj
pattern).If an application could know that these directories are
explicitly ignored, it could infer that all contents are ignored as
well and make better informed decisions about files in these
directories. It could infer that any changes under these paths would
not affect the output of status. Additionally, there can be a
significant performance benefit by avoiding scanning through ignored
directories.

When status is set to report matching ignored files, it has the
following behavior. Ignored files and directories that explicitly
match an exclude pattern are reported. If an ignored directory matches
an exclude pattern, then the path of the directory is returned. If a
directory does not match an exclude pattern, but all of its contents
are ignored, then the contained files are reported instead of the
directory.

Signed-off-by: Jameson Miller &lt;jamill@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: teach git to optionally utilize a file system monitor to speed up detecting new or changed files.</title>
<updated>2017-10-01T08:23:01Z</updated>
<author>
<name>Ben Peart</name>
<email>benpeart@microsoft.com</email>
</author>
<published>2017-09-22T16:35:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=883e248b8a0fd88773cb902ab8e91273eb147d07'/>
<id>urn:sha1:883e248b8a0fd88773cb902ab8e91273eb147d07</id>
<content type='text'>
When the index is read from disk, the fsmonitor index extension is used
to flag the last known potentially dirty index entries. The registered
core.fsmonitor command is called with the time the index was last
updated and returns the list of files changed since that time. This list
is used to flag any additional dirty cache entries and untracked cache
directories.

We can then use this valid state to speed up preload_index(),
ie_match_stat(), and refresh_cache_ent() as they do not need to lstat()
files to detect potential changes for those entries marked
CE_FSMONITOR_VALID.

In addition, if the untracked cache is turned on valid_cached_dir() can
skip checking directories for new or changed files as fsmonitor will
invalidate the cache only for those directories that have been
identified as having potential changes.

To keep the CE_FSMONITOR_VALID state accurate during git operations;
when git updates a cache entry to match the current state on disk,
it will now set the CE_FSMONITOR_VALID bit.

Inversely, anytime git changes a cache entry, the CE_FSMONITOR_VALID bit
is cleared and the corresponding untracked cache directory is marked
invalid.

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>Merge branch 'pc/dir-count-slashes'</title>
<updated>2017-06-22T21:15:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-22T21:15:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52ab95cfea15ae8a60fb4febc99d54034c8800b8'/>
<id>urn:sha1:52ab95cfea15ae8a60fb4febc99d54034c8800b8</id>
<content type='text'>
Three instances of the same helper function have been consolidated
to one.

* pc/dir-count-slashes:
  dir: create function count_slashes()
</content>
</entry>
<entry>
<title>dir: create function count_slashes()</title>
<updated>2017-06-12T20:26:55Z</updated>
<author>
<name>Prathamesh Chavan</name>
<email>pc44800@gmail.com</email>
</author>
<published>2017-06-08T18:08:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0556a928fdba489307d13d8d4c4d2a461fbc3ad'/>
<id>urn:sha1:e0556a928fdba489307d13d8d4c4d2a461fbc3ad</id>
<content type='text'>
Similar functions exist in apply.c and builtin/show-branch.c for
counting the number of slashes in a string. Also in the later
patches, we introduce a third caller for the same. Hence, we unify
it now by cleaning the existing functions and declaring a common
function count_slashes in dir.h and implementing it in dir.c to
remove this code duplication.

Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Prathamesh Chavan &lt;pc44800@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
