<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fsmonitor.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-07-23T15:15:20Z</updated>
<entry>
<title>config: drop `git_config_get_int()` wrapper</title>
<updated>2025-07-23T15:15:20Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-23T14:08:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3fda14d86d91c665e3d7c50da242cc4ddd63eea5'/>
<id>urn:sha1:3fda14d86d91c665e3d7c50da242cc4ddd63eea5</id>
<content type='text'>
In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_int()`. All
callsites are adjusted so that they use
`repo_config_get_int(the_repository, ...)` instead. While some callsites
might already have a repository available, this mechanical conversion is
the exact same as the current situation and thus cannot cause any
regression. Those sites should eventually be cleaned up in a later patch
series.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>global: mark code units that generate warnings with `-Wsign-compare`</title>
<updated>2024-12-06T11:20:02Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T10:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41f43b8243f42b9df2e98be8460646d4c0100ad3'/>
<id>urn:sha1:41f43b8243f42b9df2e98be8460646d4c0100ad3</id>
<content type='text'>
Mark code units that generate warnings with `-Wsign-compare`. This
allows for a structured approach to get rid of all such warnings over
time in a way that can be easily measured.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>global: Fix duplicate word typos</title>
<updated>2024-10-21T20:05:04Z</updated>
<author>
<name>Sven Strickroth</name>
<email>email@cs-ware.de</email>
</author>
<published>2024-10-21T15:12:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c32d4a8cfe467f5cc5df70b87db27fa210d63d4b'/>
<id>urn:sha1:c32d4a8cfe467f5cc5df70b87db27fa210d63d4b</id>
<content type='text'>
Used regex to find these typos:

    (?&lt;!struct )(?&lt;=\s)([a-z]{1,}) \1(?=\s)

Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>environment: make `get_git_work_tree()` accept a repository</title>
<updated>2024-09-12T17:15:40Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-09-12T11:29:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=edc2c92624a5389836789579ff11417ca1c61ea0'/>
<id>urn:sha1:edc2c92624a5389836789579ff11417ca1c61ea0</id>
<content type='text'>
The `get_git_work_tree()` function retrieves the path of the work tree
of `the_repository`. Make it accept a `struct repository` such that it
can work on arbitrary repositories and make it part of the repository
subsystem. This reduces our reliance on `the_repository` and clarifies
scope.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>global: prepare for hiding away repo-less config functions</title>
<updated>2024-08-13T17:01:05Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-08-13T09:14:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=219de841d9436d759fa52ea60625b60cda8476fd'/>
<id>urn:sha1:219de841d9436d759fa52ea60625b60cda8476fd</id>
<content type='text'>
We're about to hide config functions that implicitly depend on
`the_repository` behind the `USE_THE_REPOSITORY_VARIABLE` macro. This
will uncover a bunch of dependents that transitively relied on the
global variable, but didn't define the macro yet.

Adapt them such that we define the macro to prepare for this change.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: support case-insensitive events</title>
<updated>2024-03-06T17:10:06Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2024-02-26T21:39:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=29c139ce7895e1c14be119300a7f99fbdc90c5e1'/>
<id>urn:sha1:29c139ce7895e1c14be119300a7f99fbdc90c5e1</id>
<content type='text'>
Teach fsmonitor_refresh_callback() to handle case-insensitive
lookups if case-sensitive lookups fail on case-insensitive systems.
This can cause 'git status' to report stale status for files if there
are case issues/errors in the worktree.

The FSMonitor daemon sends FSEvents using the observed spelling
of each pathname.  On case-insensitive file systems this may be
different than the expected case spelling.

The existing code uses index_name_pos() to find the cache-entry for
the pathname in the FSEvent and clear the CE_FSMONITOR_VALID bit so
that the worktree scan/index refresh will revisit and revalidate the
path.

On a case-insensitive file system, the exact match lookup may fail
to find the associated cache-entry. This causes status to think that
the cached CE flags are correct and skip over the file.

Update event handling to optionally use the name-hash and dir-name-hash
if necessary.

Also update t7527 to convert the "test_expect_failure" to "_success"
now that we have fixed the bug.

Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: refactor bit invalidation in refresh callback</title>
<updated>2024-03-06T17:10:06Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2024-02-26T21:39:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b0dba507fe3bb12836100f44e2fcfdf69091fd4d'/>
<id>urn:sha1:b0dba507fe3bb12836100f44e2fcfdf69091fd4d</id>
<content type='text'>
Refactor code in the fsmonitor_refresh_callback() call chain dealing
with invalidating the CE_FSMONITOR_VALID bit and add a trace message.

During the refresh, we clear the CE_FSMONITOR_VALID bit in response to
data from the FSMonitor daemon (so that a later phase will lstat() and
verify the true state of the file).

Create a new function to clear the bit and add some unique tracing for
it to help debug edge cases.

This is similar to the existing `mark_fsmonitor_invalid()` function,
but it also does untracked-cache invalidation and we've already
handled that in the refresh-callback handlers, so but we don't need
to repeat that.

Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: trace the new invalidated cache-entry count</title>
<updated>2024-03-06T17:10:06Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2024-02-26T21:39:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=84d441f2f09d2974aac75ba93ff3a562d7d31469'/>
<id>urn:sha1:84d441f2f09d2974aac75ba93ff3a562d7d31469</id>
<content type='text'>
Consolidate the directory/non-directory calls to the refresh handler
code.  Log the resulting count of invalidated cache-entries.

The nr_in_cone value will be used in a later commit to decide if
we also need to try to do case-insensitive lookups.

Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: return invalidated cache-entry count on non-directory event</title>
<updated>2024-03-06T17:10:00Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2024-02-26T21:39:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9e34e562805986b1ed0d1518a5822b9ec495960b'/>
<id>urn:sha1:9e34e562805986b1ed0d1518a5822b9ec495960b</id>
<content type='text'>
Teach the refresh callback helper function for unqualified FSEvents
(pathnames without a trailing slash) to return the number of
cache-entries that were invalided in response to the event.

This will be used in a later commit to help determine if the observed
pathname was (possibly) case-incorrect when (on a case-insensitive
file system).

Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: remove custom loop from non-directory path handler</title>
<updated>2024-02-26T23:34:03Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2024-02-26T21:39:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=558d146d13e2632aa9cd580cbfb81fbf635c3566'/>
<id>urn:sha1:558d146d13e2632aa9cd580cbfb81fbf635c3566</id>
<content type='text'>
Refactor the code that handles refresh events for pathnames that do
not contain a trailing slash.  Instead of using a custom loop to try
to scan the index and detect if the FSEvent named a file or might be a
directory prefix, use the recently created helper function to do that.

Also update the comments to describe what and why we are doing this.

On platforms that DO NOT annotate FS events with a trailing
slash, if we fail to find an exact match for the pathname
in the index, we do not know if the pathname represents a
directory or simply an untracked file.  Pretend that the pathname
is a directory and try again before assuming it is an untracked
file.

Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
