Re: What's cooking in git.git (Dec 2023, #01; Sat, 9)
From: Jeff Hostetler <hidden>
Date: 2023-12-14 15:25:18
On 12/8/23 9:02 PM, Junio C Hamano wrote:
--------------------------------------------------
...
* jc/diff-cached-fsmonitor-fix (2023-09-15) 3 commits - diff-lib: fix check_removed() when fsmonitor is active - Merge branch 'jc/fake-lstat' into jc/diff-cached-fsmonitor-fix - Merge branch 'js/diff-cached-fsmonitor-fix' into jc/diff-cached-fsmonitor-fix (this branch uses jc/fake-lstat.) The optimization based on fsmonitor in the "diff --cached" codepath is resurrected with the "fake-lstat" introduced earlier. It is unknown if the optimization is worth resurrecting, but in case... source: <xmqqr0n0h0tw.fsf@gitster.g> --------------------------------------------------
...
* jc/fake-lstat (2023-09-15) 1 commit - cache: add fake_lstat() (this branch is used by jc/diff-cached-fsmonitor-fix.) A new helper to let us pretend that we called lstat() when we know our cache_entry is up-to-date via fsmonitor. Needs review. source: <xmqqcyykig1l.fsf@gitster.g>
I think these look good. And yes, it is better to insure that the stat struct is always well-defined rather than sometimes uninitialized. FWIW, in f954c7b8ff3 (fsmonitor: never set CE_FSMONITOR_VALID on submodules, 2022-05-26) we try to never set the CE_FSMONITOR_VALID bit on submodules (because status on a submodule is much more than just an lstat check on the submodule root directory and we always should recursively ask Git to compute the submodule's status). I haven't had time to investigate, but I wonder if the original complaint on `diff-lib` was due to another code path that allowed the CE_FSMONITOR_VALID bit to get set on a submodule entry. Jeff