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

fatal from submodule status --recursive when used with grep -q

From
MLMatt Liberty <mliberty@precisioninno.com>
Date
Sep 16, 2024, 15:08 UTC
Message-ID
<CAKDm0rNaHbzoiPg=DeuCoxzooNAsxw2BJfc0wg7fC_-=o9uJ7w@mail.gmail.com>
Hi
I have a repo with submodule, like:
% git submodule status --recursive
+834b7a0fb6de03c8e584256af2ecb7889b568343 tools/OpenROAD (v2.0-15587-g834b7a0fb)
 aafee90f8a21bf7867cef2e159929440cf45b2e5 tools/OpenROAD/src/sta
(v2.2.0-1106-gaafee90)
 ef5389d31526003c2ebd7e6d6d6fe3848a20f0a2
tools/OpenROAD/third-party/abc (remotes/origin/HEAD)
 80ba43d26264738c93900129dc0aab7fab36c53f tools/yosys (yosys-0.44)
 28d955ca97a1c4be3aed4062aec0241a734fac5d tools/yosys/abc (yosys-0.44)
If I try to grep the output I get a fatal error:

% git submodule status --recursive | grep -q "^+" fatal: failed to recurse into submodule 'tools/OpenROAD'

I didn't expect any output but did want the return status (0). I'm guessing git is unhappy that grep -q exits on the first occurrence of the pattern. I don't feel fatal is appropriate here.

I can work around this by writing to a tmpfile but would like to see this addressed.

Thanks! Matt

Next: Phillip Wood
Message 1 of 11 in “fatal from submodule status --recursive when used with grep -q”
  1. Matt LibertySep 16, 2024
  2. Phillip WoodSep 18, 2024
  3. Matt LibertySep 18, 2024
  4. Junio C HamanoSep 19, 2024
  5. Matt LibertySep 19, 2024
  6. phillip.wood123@gmail.comSep 19, 2024
  7. Matt LibertySep 19, 2024
  8. Junio C HamanoSep 19, 2024
  9. Eric SunshineSep 19, 2024
  10. Matt LibertySep 19, 2024
  11. phillip.wood123@gmail.comSep 20, 2024

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.