{"thread":{"id":"62516","subject":"fresh ls-files looks inside submodules even when not asked to or asked not to","startedAt":"2024-11-19T16:26:01Z","lastAt":"2024-11-19T16:26:01Z","messageCount":1,"participants":["Yaroslav Halchenko"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"507629","messageId":"ZzyyQpJw-kxJA7IS@bilena","threadId":"62516","inReplyTo":null,"subject":"fresh ls-files looks inside submodules even when not asked to or asked not to","fromName":"Yaroslav Halchenko","fromEmail":"yoh@onerussian.com","sentAt":"2024-11-19T15:44:02Z","receivedAt":"2024-11-19T16:26:01Z","isPatch":false,"sender":{"key":"yoh@onerussian.com","avatar":"https://gravatar.com/avatar/8901b82415ae451a83aea49409708912726e53620e3ac92320bf1f86548d97e9?d=mp&s=160"},"body":"Dear Git Gurus,\n\nHere is a report prepared with a new glorious \"git bugreport\" which I\nhoped would also automagically send it out.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\n\tPrior version (e.g. 2.45.2) had this issue \"hidden\": ls-files was\n\tjust reporting error to stderr but exiting with exit code 0.  So our test in\n\tDataLad which creates an artificial situation with permissions to .git/config\n\twithin submodule did not trigger error.\n\nWhat did you expect to happen? (Expected behavior)\n\n\tIdeally -- 'git ls-files -m -d --no-recurse-submodules'\n\tshould not even consult submodules' .git/config . I am not yet 100% certain that it should without explicit '--recurse-submodules'.\n\nWhat happened instead? (Actual behavior)\n\n    regardless which options (-x sub3  or --no-recurse-submodules) I add,\n    git ls-files does try to access submodules .git/config:\n\n    ❯ pwd\n    /home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2\n\t❯ ls -ld .git/config\n\t-rw-rw-r-- 1 yoh yoh 333 Nov 19 10:11 .git/config\n\t❯ ls -ld sub3/.git/config\n\t---------- 1 yoh yoh 285 Nov 19 10:11 sub3/.git/config\n    ❯ git --version\n    git version 2.47.0.288.g090d24e9af\n\n    ❯ git ls-files  -m -d\n    warning: unable to access '/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2/sub3/.git/config': Permission denied\n    fatal: unable to access '/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2/sub3/.git/config': Permission denied\n    ❯ echo $?\n    128\n   \n    ❯ git ls-files -m -d --no-recurse-submodules -x sub3\n    warning: unable to access '/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2/sub3/.git/config': Permission denied\n    fatal: unable to access '/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2/sub3/.git/config': Permission denied\n    ❯ echo $?\n    128\n\n\tNB then also tried with \"next\" 2.47.0.376.g95f8e04e20 to the same effect.\n\nWhat's different between what you expected and what actually happened?\n\n    git ls-files did descend into submodule to check its .git/config for no\n    reason IMHO.\n\nAnything else you want to add:\n\n    Thank you for creating this helper to file issues!  Note that a\n    slight mental dichotomy was caused by the fact that you named it \"git\n    bugreport\" whenever debian has \"reportbug\" so now it would take extra\n    mental effort to remember who has what\n\n\n[System Info]\ngit version:\ngit version 2.47.0.288.g090d24e9af\ncpu: x86_64\nbuilt from commit: 090d24e9af6e9f59c3f7bee97c42bb1ae3c7f559\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nlibcurl: 8.11.0\nOpenSSL: OpenSSL 3.3.2 3 Sep 2024\nzlib: 1.3.1\nuname: Linux 6.11.5-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.5-1 (2024-10-27) x86_64\ncompiler info: gnuc: 14.2\nlibc info: glibc: 2.40\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\npost-checkout\npost-merge\npost-receive\npre-commit\n\n\nThank you in advance!\n-- \nYaroslav O. Halchenko\nCenter for Open Neuroscience     http://centerforopenneuroscience.org\nDartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755\nWWW:   http://www.linkedin.com/in/yarik        \n\n"}]}