Context for reviewers: The mechanism part of this patch is equivalent to [1] and [2]. With the following changes: * The configuration code is a bit different and we now expose a `writeout-only` mode to the user. This mode is the default on macOS to prevent a change in end-user behavior. * git_fsync now contains the EINTR retry loop internally. [1] https://lore.kernel.org/git/e1747ce00af7ab3170a69955b07d995d5321d6f3.1637020263.git.gitgitgadget@xxxxxxxxx/ [2] https://lore.kernel.org/git/546ad9c82e8e0c2eb4683f9f360d8f30e2136020.1630108177.git.gitgitgadget@xxxxxxxxx/