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

[PATCH v2 0/3] teach git to respect fsmonitor in diff-index

From
Nipunn Koorapati via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 17, 2021, 21:22 UTC
Message-ID
<pull.903.v2.git.1616016143.gitgitgadget@gmail.com>
In-Reply-To
<pull.903.git.1615760258.gitgitgadget@gmail.com>

Skip lstat deletion check during git diff-index (similar to how it already does so in git diff-files). Add perf benchmark for this case. Add assert for guaranteeing that fsmonitor is refreshed in this case.

Update since Patch Series V1:
 * Fix spaces->tabs issue in fsmonitor.h
 * Remove comment in test-chmtime.c - to avoid it going stale
cc: Eric Sunshine sunshine@sunshineco.com
Nipunn Koorapati (3):
  fsmonitor: skip lstat deletion check during git diff-index
  fsmonitor: add assertion that fsmonitor is valid to check_removed
  fsmonitor: add perf test for git diff HEAD
 diff-lib.c                | 23 +++++++++++++++--------
 fsmonitor.h               | 11 +++++++++++
 t/helper/test-chmtime.c   |  4 ++--
 t/perf/p7519-fsmonitor.sh |  4 ++++
 4 files changed, 32 insertions(+), 10 deletions(-)
base-commit: 13d7ab6b5d7929825b626f050b62a11241ea4945
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-903%2Fnipunn1313%2Fnk%2Ffsmonitor-in-diff-index-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-903/nipunn1313/nk/fsmonitor-in-diff-index-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/903
Range-diff vs v1:
 1:  75a3c46c4055 = 1:  75a3c46c4055 fsmonitor: skip lstat deletion check during git diff-index
 2:  dda5b537a3f0 ! 2:  afd326c5011b fsmonitor: add assertion that fsmonitor is valid to check_removed
     @@ fsmonitor.h: void refresh_fsmonitor(struct index_state *istate);
      + */
      +static inline int is_fsmonitor_refreshed(const struct index_state *istate)
      +{
     -+    return !core_fsmonitor || istate->fsmonitor_has_run_once;
     ++	return !core_fsmonitor || istate->fsmonitor_has_run_once;
      +}
      +
       /*
 3:  740302586dd8 ! 3:  f9d0fd594fdb fsmonitor: add perf test for git diff HEAD
     @@ Commit message
      
       ## t/helper/test-chmtime.c ##
      @@ t/helper/test-chmtime.c: int cmd__chmtime(int argc, const char **argv)
     + 		uintmax_t mtime;
     + 
       		if (stat(argv[i], &sb) < 0) {
     - 			fprintf(stderr, "Failed to stat %s: %s\n",
     +-			fprintf(stderr, "Failed to stat %s: %s\n",
     ++			fprintf(stderr, "Failed to stat %s: %s. Skipping\n",
       			        argv[i], strerror(errno));
      -			return 1;
     -+			// Skip and move on - eg if it's a broken symlink
      +			continue;
       		}
       
-- 
gitgitgadget
Previous: Eric SunshineNext: Nipunn Koorapati via GitGitGadget
Message 8 of 15 in “teach git to respect fsmonitor in diff-index”
  1. 0/3 teach git to respect fsmonitor in diff-indexNipunn Koorapati via GitGitGadget, Mar 14, 2021
  2. 1/3 fsmonitor: skip lstat deletion check during git diff-indexNipunn Koorapati via GitGitGadget, Mar 14, 2021
  3. 3/3 fsmonitor: add perf test for git diff HEADNipunn Koorapati via GitGitGadget, Mar 14, 2021
  4. 2/3 fsmonitor: add assertion that fsmonitor is valid to check_removedNipunn Koorapati via GitGitGadget, Mar 14, 2021
  5. Eric SunshineMar 14, 2021
  6. Nipunn KoorapatiMar 15, 2021
  7. Eric SunshineMar 15, 2021
  8. 0/3 teach git to respect fsmonitor in diff-indexNipunn Koorapati via GitGitGadget, Mar 17, 2021
  9. 1/3 fsmonitor: skip lstat deletion check during git diff-indexNipunn Koorapati via GitGitGadget, Mar 17, 2021
  10. Junio C HamanoMar 18, 2021
  11. Nipunn KoorapatiMar 18, 2021
  12. 3/3 fsmonitor: add perf test for git diff HEADNipunn Koorapati via GitGitGadget, Mar 17, 2021
  13. 2/3 fsmonitor: add assertion that fsmonitor is valid to check_removedNipunn Koorapati via GitGitGadget, Mar 17, 2021
  14. Junio C HamanoMar 18, 2021
  15. Nipunn KoorapatiMar 18, 2021

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.