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

[PATCH v3 0/2] Fix fsmonitor after discard_index()

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 7, 2019, 11:10 UTC
Message-ID
<20190507111021.12840-1-avarab@gmail.com>
In-Reply-To
<pull.165.v2.git.gitgitgadget@gmail.com>

This v3 is all Johannes's patches. The outstanding review on v2 could be clarified with a commit message change, which I've addressed, and v2 conflicted with a cache.h change that's since landed in "master", which I've rebased this on.

Junio: We're getting closer to the release so it would be great to
have this. It's been broken for a long time, but having this finaly
fixed in v2.22 would be great. The functional code changes are also
isolated to the fsmonitor code path, which reduces the risk and makes
this easier to review/reason about.
Johannes Schindelin (2):
  fsmonitor: demonstrate that it is not refreshed after discard_index()
  fsmonitor: force a refresh after the index was discarded
 cache.h                     |  3 ++-
 fsmonitor.c                 |  5 ++---
 read-cache.c                |  1 +
 t/helper/test-read-cache.c  | 24 +++++++++++++++++++++++-
 t/t7519-status-fsmonitor.sh |  8 ++++++++
 5 files changed, 36 insertions(+), 5 deletions(-)
Range-diff:
1:  51a7edf22a = 1:  c31f834b07 fsmonitor: demonstrate that it is not refreshed after discard_index()
2:  79fdd0d586 ! 2:  7bf5f9f610 fsmonitor: force a refresh after the index was discarded
    @@ -6,8 +6,10 @@
         flag that says whether the fsmonitor hook has been run, i.e. it is now
         per-index.
     
    -    It also gets re-set when the index is discarded, fixing the bug where
    -    fsmonitor-enabled Git would miss updates under certain circumstances.
    +    It also gets re-set when the index is discarded, fixing the bug
    +    demonstrated by the "test_expect_failure" test added in the preceding
    +    commit. In that case fsmonitor-enabled Git would miss updates under
    +    certain circumstances, see that preceding commit for details.
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    @@ -15,11 +17,11 @@
      --- a/cache.h
      +++ b/cache.h
     @@
    - 	struct cache_time timestamp;
    - 	unsigned name_hash_initialized : 1,
      		 initialized : 1,
    --		 drop_cache_tree : 1;
    -+		 drop_cache_tree : 1,
    + 		 drop_cache_tree : 1,
    + 		 updated_workdir : 1,
    +-		 updated_skipworktree : 1;
    ++		 updated_skipworktree : 1,
     +		 fsmonitor_has_run_once : 1;
      	struct hashmap name_hash;
      	struct hashmap dir_hash;
-- 
2.21.0.593.g511ec345e18
Previous: SZEDER GáborNext: Junio C Hamano
Message 13 of 17 in “Fix fsmonitor after discard_index()”
  1. 0/2 Fix fsmonitor after discard_index()Johannes Schindelin via GitGitGadget, Mar 16, 2019
  2. 1/2 fsmonitor: demonstrate that it is not refreshed after discard_index()Johannes Schindelin via GitGitGadget, Mar 16, 2019
  3. Johannes SixtMar 16, 2019
  4. Johannes SchindelinMar 21, 2019
  5. 2/2 fsmonitor: force a refresh after the index was discardedJohannes Schindelin via GitGitGadget, Mar 16, 2019
  6. Ævar Arnfjörð BjarmasonMar 18, 2019
  7. Johannes SchindelinMar 21, 2019
  8. Johannes SchindelinMay 23, 2019
  9. 0/2 Fix fsmonitor after discard_index()Johannes Schindelin via GitGitGadget, Mar 21, 2019
  10. 1/2 fsmonitor: demonstrate that it is not refreshed after discard_index()Johannes Schindelin via GitGitGadget, Mar 21, 2019
  11. 2/2 fsmonitor: force a refresh after the index was discardedJohannes Schindelin via GitGitGadget, Mar 21, 2019
  12. SZEDER GáborMar 22, 2019
  13. 0/2 Fix fsmonitor after discard_index()Ævar Arnfjörð Bjarmason, May 7, 2019
  14. Junio C HamanoMay 7, 2019
  15. Junio C HamanoMay 8, 2019
  16. 1/2 fsmonitor: demonstrate that it is not refreshed after discard_index()Ævar Arnfjörð Bjarmason, May 7, 2019
  17. 2/2 fsmonitor: force a refresh after the index was discardedÆvar Arnfjörð Bjarmason, May 7, 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.