git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Strange diff-index with fsmonitor, submodules
@ 2023-08-29  0:56 Jonathan Tan
  2023-08-29  1:20 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Jonathan Tan @ 2023-08-29  0:56 UTC (permalink / raw)
  To: git; +Cc: Jonathan Tan

There is a strange interaction where diff-index not only produces
different results when run with and without fsmonitor, but produces
different results for 2 entries that as far as I can tell, should behave
identically (sibling files in the same directory - file_11 and file_12,
and both of these filenames are only mentioned once each in the entire
test).

You can see this with this patch:

diff --git a/t/t7527-builtin-fsmonitor.sh b/t/t7527-builtin-fsmonitor.sh
index 0c241d6c14..e9e5e32016 100755
--- a/t/t7527-builtin-fsmonitor.sh
+++ b/t/t7527-builtin-fsmonitor.sh
@@ -809,6 +809,11 @@ my_match_and_clean () {
                status --porcelain=v2 >actual.without &&
        test_cmp actual.with actual.without &&
 
+       git -C super --no-optional-locks diff-index --name-status HEAD >actual.with &&
+       git -C super --no-optional-locks -c core.fsmonitor=false \
+               diff-index --name-status HEAD >actual.without &&
+       test_cmp actual.with actual.without &&
+
        git -C super/dir_1/dir_2/sub reset --hard &&
        git -C super/dir_1/dir_2/sub clean -d -f
 }
@@ -837,6 +842,7 @@ test_expect_success 'submodule always visited' '
        # some dirt in the submodule and confirm matching output.
 
        # Completely clean status.
+       echo Now running for clean status &&
        my_match_and_clean &&

and this is the output:

++ echo Now running for clean status
Now running for clean status
++ my_match_and_clean
++ git -C super --no-optional-locks status --porcelain=v2
++ git -C super --no-optional-locks -c core.fsmonitor=false status --porcelain=v2
++ test_cmp actual.with actual.without
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u actual.with actual.without
++ git -C super --no-optional-locks diff-index --name-status HEAD
++ git -C super --no-optional-locks -c core.fsmonitor=false diff-index --name-status HEAD
++ test_cmp actual.with actual.without
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u actual.with actual.without
--- actual.with	2023-08-29 00:39:26
+++ actual.without	2023-08-29 00:39:26
@@ -1 +0,0 @@
-D	dir_1/file_11
error: last command exited with $?=1
not ok 61 - submodule always visited

Notice that with fsmonitor, diff-index reports a "D" line that is not
present when fsmonitor is off. To add to that, it only reports "D" for
file_11 when I would expect that if it reported file_11, it would report
file_12 as well.

I'll continue investigating this myself, but does anyone know what is
going on?

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-09-18 16:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29  0:56 Strange diff-index with fsmonitor, submodules Jonathan Tan
2023-08-29  1:20 ` Junio C Hamano
2023-08-29 12:45   ` Jeff Hostetler
2023-08-29 16:57 ` Jeff Hostetler
2023-08-29 17:01   ` Jonathan Tan
2023-09-06  6:02 ` [PATCH] [diff-lib] Fix check_removed when fsmonitor is on Josip Sokcevic
2023-09-06 20:37   ` Jonathan Tan
2023-09-07 17:01     ` [PATCH v2] diff-lib: " Josip Sokcevic
2023-09-07 17:22       ` Jonathan Tan
2023-09-07 18:07       ` Junio C Hamano
2023-09-07 23:08         ` Josip Sokcevic
2023-09-08 15:00           ` Junio C Hamano
2023-09-11 17:09   ` [PATCH v3] " Josip Sokcevic
2023-09-11 22:53     ` Junio C Hamano
2023-09-12  3:03       ` Josip Sokcevic
2023-09-12 17:07         ` Junio C Hamano
2023-09-14 22:39           ` Josip Sokcevic
2023-09-18 16:35             ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).