From: Matt Liberty <mliberty@precisioninno.com>
To: phillip.wood@dunelm.org.uk
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: fatal from submodule status --recursive when used with grep -q
Date: Thu, 19 Sep 2024 08:17:17 -0700 [thread overview]
Message-ID: <CAKDm0rO6H4RTa5EXMrNvSy2swVegHveasY1koZXF5V7HvZzK0Q@mail.gmail.com> (raw)
In-Reply-To: <467f6fb4-5f83-416b-bc09-572a82f210ea@gmail.com>
Yes and also to have a 0 exit code. No error occurred from my perspective.
Matt
On Thu, Sep 19, 2024 at 7:22 AM <phillip.wood123@gmail.com> wrote:
>
> On 18/09/2024 15:28, Matt Liberty wrote:
> > I'm not trying to capture the exit status of git but of grep. Compare
> > it to "yes|grep -q y" which doesn't generate any error even though yes
> > generates endless output.
>
> Sorry, I'd misunderstood your original message. So the problem is that
> you want "git submodule status" to be quiet (i.e. not print an error
> message) when it dies of SIGPIPE?
>
> Best Wishes
>
> Phillip
>
> > Matt
> >
> > On Wed, Sep 18, 2024 at 3:05 AM Phillip Wood <phillip.wood123@gmail.com
> > <mailto:phillip.wood123@gmail.com>> wrote:
> >
> > Hi Matt
> >
> > 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.
> >
> > Best Wishes
> >
> > PhillipSo
> >
> > > I can work around this by writing to a tmpfile but would like to see
> > > this addressed.
> > >
> > > Thanks!
> > > Matt
> > >
> >
next prev parent reply other threads:[~2024-09-19 15:17 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
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 [this message]
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=CAKDm0rO6H4RTa5EXMrNvSy2swVegHveasY1koZXF5V7HvZzK0Q@mail.gmail.com \
--to=mliberty@precisioninno.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=phillip.wood@dunelm.org.uk \
/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).