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

git diff: --submodule=diff does not synergise with --name-only

From
SSainan <sainan@calamity.inc>
Date
Nov 3, 2025, 10:51 UTC
Message-ID
<C6Lp4oh3zEx1R6wysONzY_opvR6SE1GVNIHwMp1tXuAp_ob7jehtLPbu7XguZdU6vQ_Djq7ADBHOLrn3g4am4brUiiS6yzwpDCjIK_QaR00=@calamity.inc>
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
Message 1 of 1 in “git diff: --submodule=diff does not synergise with --name-only”
  1. SainanNov 3, 2025

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.