git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: Matt Liberty <mliberty@precisioninno.com>,  git@vger.kernel.org
Subject: Re: fatal from submodule status --recursive when used with grep -q
Date: Wed, 18 Sep 2024 18:16:50 -0700	[thread overview]
Message-ID: <xmqq1q1ga1dp.fsf@gitster.g> (raw)
In-Reply-To: <7b4ce2fc-3763-4881-8459-e0c1f2cbc69d@gmail.com> (Phillip Wood's message of "Wed, 18 Sep 2024 11:05:08 +0100")

Phillip Wood <phillip.wood123@gmail.com> writes:

> On 16/09/2024 16:08, Matt Liberty wrote:
>> 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 assume git is dying with SIGPIPE. As the only purpose of "git
> submodule status" is to write the status information to stdout that
> sounds reasonable. If you want to collect the exit status you need to
> consume the whole output so that the command runs to completion.

Yes, but isn't the main point of that complaint that "failed to
recurse into" is not a good way to say "because you closed the
reading end of the pipe, we are aborting the operation and not
decending into 'tools/OpenROAD' submodule", is it?


  parent reply	other threads:[~2024-09-19  1:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 15:08 fatal from submodule status --recursive when used with grep -q Matt Liberty
2024-09-18 10:05 ` Phillip Wood
2024-09-18 14:45   ` Matt Liberty
2024-09-19  1:16   ` Junio C Hamano [this message]
2024-09-19 13:23     ` Matt Liberty
     [not found]   ` <CAKDm0rMsXUpFSWRWkW0J0FUpEbot6wQqdzYTT5CLZ=3TGbV-OA@mail.gmail.com>
2024-09-19 14:22     ` phillip.wood123
2024-09-19 15:17       ` Matt Liberty
2024-09-19 19:09         ` Junio C Hamano
2024-09-19 19:40           ` Eric Sunshine
2024-09-19 20:10             ` Matt Liberty
2024-09-20 13:12               ` phillip.wood123

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=xmqq1q1ga1dp.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mliberty@precisioninno.com \
    --cc=phillip.wood123@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).