git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/1] unpack-trees: skip stat on fsmonitor-valid files

From
Utsav Shah via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 4, 2019, 23:41 UTC
Message-ID
<pull.446.git.1572910885.gitgitgadget@gmail.com>

The index might be aware that a file hasn't modified via fsmonitor, but unpack-trees did not pay attention to it and checked via ie_match_stat which can be inefficient on certain filesystems. This significantly slows down commands that run oneway_merge, like checkout and reset --hard.

This patch makes oneway_merge check whether a file is considered unchanged through fsmonitor and skips ie_match_stat on it. unpack-trees also now correctly copies over fsmonitor validity state from the source index. Finally, for correctness, we force a refresh of fsmonitor state in tweak_fsmonitor.

After this change, commands like stash (that use reset --hard internally) go from 8s or more to ~2s on a 250k file repository on a mac.

Signed-off-by: Utsav Shah utsav@dropbox.com [utsav@dropbox.com]
Utsav Shah (1):
  unpack-trees: skip stat on fsmonitor-valid files
 fsmonitor.c                       | 20 +++++++++++---------
 t/t7113-post-index-change-hook.sh |  3 ---
 t/t7519-status-fsmonitor.sh       |  9 +++++++--
 unpack-trees.c                    |  6 +++++-
 4 files changed, 23 insertions(+), 15 deletions(-)
base-commit: 566a1439f6f56c2171b8853ddbca0ad3f5098770
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-446%2FUtsav2%2Fskip-lstat-2-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-446/Utsav2/skip-lstat-2-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/446
-- 
gitgitgadget
Next: Utsav Shah via GitGitGadget
Message 1 of 3 in “unpack-trees: skip stat on fsmonitor-valid files”
  1. 0/1 unpack-trees: skip stat on fsmonitor-valid filesUtsav Shah via GitGitGadget, Nov 4, 2019
  2. 1/1 unpack-trees: skip stat on fsmonitor-valid filesUtsav Shah via GitGitGadget, Nov 4, 2019
  3. Utsav ShahNov 5, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.