From: Sainan <sainan@calamity.inc>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: git diff: --submodule=diff does not synergise with --name-only
Date: Mon, 03 Nov 2025 10:51:10 +0000 [thread overview]
Message-ID: <C6Lp4oh3zEx1R6wysONzY_opvR6SE1GVNIHwMp1tXuAp_ob7jehtLPbu7XguZdU6vQ_Djq7ADBHOLrn3g4am4brUiiS6yzwpDCjIK_QaR00=@calamity.inc> (raw)
Hi, I'm using Git v2.51.2.windows.1 but this bug may have existed as far back as when --submodule=diff was introduced according to my research.
To reproduce this, you need a repository with a submodule which was changed since a given tag, then it can be observed like so:
1. git diff --name-only --submodule=diff <tag> | wc -l
2. git diff --submodule=diff <tag> | grep "diff --git" | wc -l
You should notice a discrepency between the line counts because in the first case only the submodule path is listed, whereas in the second case it correctly recurses into the submodule and lists the files changed in those submodules.
-- Sainan
reply other threads:[~2025-11-03 10:55 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='C6Lp4oh3zEx1R6wysONzY_opvR6SE1GVNIHwMp1tXuAp_ob7jehtLPbu7XguZdU6vQ_Djq7ADBHOLrn3g4am4brUiiS6yzwpDCjIK_QaR00=@calamity.inc' \
--to=sainan@calamity.inc \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).