<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache.h, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-06-08T21:27:53Z</updated>
<entry>
<title>Merge branch 'ds/midx-normalize-pathname-before-comparison' into maint</title>
<updated>2022-06-08T21:27:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-06-08T21:27:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=67c305f72290312e19113635023fed1e133d4f66'/>
<id>urn:sha1:67c305f72290312e19113635023fed1e133d4f66</id>
<content type='text'>
The path taken by "git multi-pack-index" command from the end user
was compared with path internally prepared by the tool withut first
normalizing, which lead to duplicated paths not being noticed,
which has been corrected.
source: &lt;pull.1221.v2.git.1650911234.gitgitgadget@gmail.com&gt;

* ds/midx-normalize-pathname-before-comparison:
  cache: use const char * for get_object_directory()
  multi-pack-index: use --object-dir real path
  midx: use real paths in lookup_multi_pack_index()
</content>
</entry>
<entry>
<title>cache: use const char * for get_object_directory()</title>
<updated>2022-04-25T18:31:13Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-04-25T18:27:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=11f9e8de3d1a3d484c452141f1fcdbd707457ec0'/>
<id>urn:sha1:11f9e8de3d1a3d484c452141f1fcdbd707457ec0</id>
<content type='text'>
The get_object_directory() method returns the exact string stored at
the_repository-&gt;objects-&gt;odb-&gt;path. The return type of "char *" implies
that the caller must keep track of the buffer and free() it when
complete. This causes significant problems later when the ODB is
accessed.

Use "const char *" as the return type to avoid this confusion. There are
no current callers that care about the non-const definition.

Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jh/builtin-fsmonitor-part2'</title>
<updated>2022-04-04T17:56:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-04T17:56:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=439c1e6d5d8ad4d1134fc6ff5e514d28ff9ecac4'/>
<id>urn:sha1:439c1e6d5d8ad4d1134fc6ff5e514d28ff9ecac4</id>
<content type='text'>
Built-in fsmonitor (part 2).

* jh/builtin-fsmonitor-part2: (30 commits)
  t7527: test status with untracked-cache and fsmonitor--daemon
  fsmonitor: force update index after large responses
  fsmonitor--daemon: use a cookie file to sync with file system
  fsmonitor--daemon: periodically truncate list of modified files
  t/perf/p7519: add fsmonitor--daemon test cases
  t/perf/p7519: speed up test on Windows
  t/perf/p7519: fix coding style
  t/helper/test-chmtime: skip directories on Windows
  t/perf: avoid copying builtin fsmonitor files into test repo
  t7527: create test for fsmonitor--daemon
  t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon
  help: include fsmonitor--daemon feature flag in version info
  fsmonitor--daemon: implement handle_client callback
  compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS
  compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent
  compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend on Windows
  fsmonitor--daemon: create token-based changed path cache
  fsmonitor--daemon: define token-ids
  fsmonitor--daemon: add pathname classification
  fsmonitor--daemon: implement 'start' command
  ...
</content>
</entry>
<entry>
<title>Merge branch 'ns/core-fsyncmethod'</title>
<updated>2022-04-04T17:56:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-04T17:56:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27dd46079980a8f80c5e70bc8fa5ee4c9b54995e'/>
<id>urn:sha1:27dd46079980a8f80c5e70bc8fa5ee4c9b54995e</id>
<content type='text'>
A couple of fix-up to a topic that is now in 'master'.

* ns/core-fsyncmethod:
  core.fsyncmethod: correctly camel-case warning message
  core.fsync: fix incorrect expression for default configuration
</content>
</entry>
<entry>
<title>core.fsync: fix incorrect expression for default configuration</title>
<updated>2022-03-29T23:04:16Z</updated>
<author>
<name>Neeraj Singh</name>
<email>neerajsi@microsoft.com</email>
</author>
<published>2022-03-29T21:41:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5ec440c982417d39908b9a4bab79523a6a37f6c'/>
<id>urn:sha1:e5ec440c982417d39908b9a4bab79523a6a37f6c</id>
<content type='text'>
Commit b9f5d035 (core.fsync: documentation and user-friendly
aggregate options, 2022-03-15) introduced an incorrect value for
FSYNC_COMPONENTS_DEFAULT. We need an AND-NOT rather than OR-NOT.

Signed-off-by: Neeraj Singh &lt;neerajsi@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/fsync-refs'</title>
<updated>2022-03-25T23:38:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-25T23:38:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e1a8952e90e5d125177dbdee21425d1ba2d3584'/>
<id>urn:sha1:6e1a8952e90e5d125177dbdee21425d1ba2d3584</id>
<content type='text'>
Updates to refs traditionally weren't fsync'ed, but we can
configure using core.fsync variable to do so.

* ps/fsync-refs:
  core.fsync: new option to harden references
</content>
</entry>
<entry>
<title>Merge branch 'ns/core-fsyncmethod'</title>
<updated>2022-03-25T23:38:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-25T23:38:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb804cd405618ef78b772072685c39392aea4ac1'/>
<id>urn:sha1:eb804cd405618ef78b772072685c39392aea4ac1</id>
<content type='text'>
Replace core.fsyncObjectFiles with two new configuration variables,
core.fsync and core.fsyncMethod.

* ns/core-fsyncmethod:
  core.fsync: documentation and user-friendly aggregate options
  core.fsync: new option to harden the index
  core.fsync: add configuration parsing
  core.fsync: introduce granular fsync control infrastructure
  core.fsyncmethod: add writeout-only mode
  wrapper: make inclusion of Windows csprng header tightly scoped
</content>
</entry>
<entry>
<title>fsmonitor: config settings are repository-specific</title>
<updated>2022-03-25T23:04:15Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-03-25T18:02:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e0ea5c4316d2241dd76ef430a2779db9a097dfb'/>
<id>urn:sha1:1e0ea5c4316d2241dd76ef430a2779db9a097dfb</id>
<content type='text'>
Move fsmonitor config settings to a new and opaque
`struct fsmonitor_settings` structure.  Add a lazily-loaded pointer
to this into `struct repo_settings`

Create an `enum fsmonitor_mode` type in `struct fsmonitor_settings` to
represent the state of fsmonitor.  This lets us represent which, if
any, fsmonitor provider (hook or IPC) is enabled.

Create `fsm_settings__get_*()` getters to lazily look up fsmonitor-
related config settings.

Get rid of the `core_fsmonitor` global variable.  Move the code to
lookup the existing `core.fsmonitor` config value into the fsmonitor
settings.

Create a hook pathname variable in `struct fsmonitor-settings` and
only set it when in hook mode.

Extend the definition of `core.fsmonitor` to be either a boolean
or a hook pathname.  When true, the builtin FSMonitor is used.
When false or unset, no FSMonitor (neither builtin nor hook) is
used.

The existing `core_fsmonitor` global variable was used to store the
pathname to the fsmonitor hook *and* it was used as a boolean to see
if fsmonitor was enabled.  This dual usage and global visibility leads
to confusion when we add the IPC-based provider.  So lets hide the
details in fsmonitor-settings.c and let it decide which provider to
use in the case of multiple settings.  This avoids cluttering up
repo-settings.c with these private details.

A future commit in builtin-fsmonitor series will add the ability to
disqualify worktrees for various reasons, such as being mounted from a
remote volume, where fsmonitor should not be started.  Having the
config settings hidden in fsmonitor-settings.c allows such worktree
restrictions to override the config values used.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/object-file-api-updates'</title>
<updated>2022-03-17T00:53:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-17T00:53:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=430883a70c79614e52279f2800a9a383ffc68fe5'/>
<id>urn:sha1:430883a70c79614e52279f2800a9a383ffc68fe5</id>
<content type='text'>
Object-file API shuffling.

* ab/object-file-api-updates:
  object-file API: pass an enum to read_object_with_reference()
  object-file.c: add a literal version of write_object_file_prepare()
  object-file API: have hash_object_file() take "enum object_type"
  object API: rename hash_object_file_literally() to write_*()
  object-file API: split up and simplify check_object_signature()
  object API users + docs: check &lt;0, not !0 with check_object_signature()
  object API docs: move check_object_signature() docs to cache.h
  object API: correct "buf" v.s. "map" mismatch in *.c and *.h
  object-file API: have write_object_file() take "enum object_type"
  object-file API: add a format_object_header() function
  object-file API: return "void", not "int" from hash_object_file()
  object-file.c: split up declaration of unrelated variables
</content>
</entry>
<entry>
<title>core.fsync: new option to harden references</title>
<updated>2022-03-15T20:30:58Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2022-03-11T09:58:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc22d845c4328f5bd896d019b3729f776ad4be4c'/>
<id>urn:sha1:bc22d845c4328f5bd896d019b3729f776ad4be4c</id>
<content type='text'>
When writing both loose and packed references to disk we first create a
lockfile, write the updated values into that lockfile, and on commit we
rename the file into place. According to filesystem developers, this
behaviour is broken because applications should always sync data to disk
before doing the final rename to ensure data consistency [1][2][3]. If
applications fail to do this correctly, a hard crash of the machine can
easily result in corrupted on-disk data.

This kind of corruption can in fact be easily observed with Git when the
machine hard-resets shortly after writing references to disk. On
machines with ext4, this will likely lead to the "empty files" problem:
the file has been renamed, but its data has not been synced to disk. The
result is that the reference is corrupt, and in the worst case this can
lead to data loss.

Implement a new option to harden references so that users and admins can
avoid this scenario by syncing locked loose and packed references to
disk before we rename them into place.

[1]: https://thunk.org/tytso/blog/2009/03/15/dont-fear-the-fsync/
[2]: https://btrfs.wiki.kernel.org/index.php/FAQ (What are the crash guarantees of overwrite-by-rename)
[3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/ext4.rst (see auto_da_alloc)

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
