From: Yaroslav Halchenko <yoh@onerussian.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: fresh ls-files looks inside submodules even when not asked to or asked not to
Date: Tue, 19 Nov 2024 10:44:02 -0500 [thread overview]
Message-ID: <ZzyyQpJw-kxJA7IS@bilena> (raw)
Dear Git Gurus,
Here is a report prepared with a new glorious "git bugreport" which I
hoped would also automagically send it out.
What did you do before the bug happened? (Steps to reproduce your issue)
Prior version (e.g. 2.45.2) had this issue "hidden": ls-files was
just reporting error to stderr but exiting with exit code 0. So our test in
DataLad which creates an artificial situation with permissions to .git/config
within submodule did not trigger error.
What did you expect to happen? (Expected behavior)
Ideally -- 'git ls-files -m -d --no-recurse-submodules'
should not even consult submodules' .git/config . I am not yet 100% certain that it should without explicit '--recurse-submodules'.
What happened instead? (Actual behavior)
regardless which options (-x sub3 or --no-recurse-submodules) I add,
git ls-files does try to access submodules .git/config:
❯ pwd
/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2
❯ ls -ld .git/config
-rw-rw-r-- 1 yoh yoh 333 Nov 19 10:11 .git/config
❯ ls -ld sub3/.git/config
---------- 1 yoh yoh 285 Nov 19 10:11 sub3/.git/config
❯ git --version
git version 2.47.0.288.g090d24e9af
❯ git ls-files -m -d
warning: unable to access '/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2/sub3/.git/config': Permission denied
fatal: unable to access '/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2/sub3/.git/config': Permission denied
❯ echo $?
128
❯ git ls-files -m -d --no-recurse-submodules -x sub3
warning: unable to access '/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2/sub3/.git/config': Permission denied
fatal: unable to access '/home/yoh/.tmp/datalad_temp_test_subsuperdataset_savechl3cwws/sub1/sub2/sub3/.git/config': Permission denied
❯ echo $?
128
NB then also tried with "next" 2.47.0.376.g95f8e04e20 to the same effect.
What's different between what you expected and what actually happened?
git ls-files did descend into submodule to check its .git/config for no
reason IMHO.
Anything else you want to add:
Thank you for creating this helper to file issues! Note that a
slight mental dichotomy was caused by the fact that you named it "git
bugreport" whenever debian has "reportbug" so now it would take extra
mental effort to remember who has what
[System Info]
git version:
git version 2.47.0.288.g090d24e9af
cpu: x86_64
built from commit: 090d24e9af6e9f59c3f7bee97c42bb1ae3c7f559
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
libcurl: 8.11.0
OpenSSL: OpenSSL 3.3.2 3 Sep 2024
zlib: 1.3.1
uname: Linux 6.11.5-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.5-1 (2024-10-27) x86_64
compiler info: gnuc: 14.2
libc info: glibc: 2.40
$SHELL (typically, interactive shell): /bin/zsh
[Enabled Hooks]
post-checkout
post-merge
post-receive
pre-commit
Thank you in advance!
--
Yaroslav O. Halchenko
Center for Open Neuroscience http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
WWW: http://www.linkedin.com/in/yarik
reply other threads:[~2024-11-19 16:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZzyyQpJw-kxJA7IS@bilena \
--to=yoh@onerussian.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox