All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: 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 11:05:08 +0100	[thread overview]
Message-ID: <7b4ce2fc-3763-4881-8459-e0c1f2cbc69d@gmail.com> (raw)
In-Reply-To: <CAKDm0rNaHbzoiPg=DeuCoxzooNAsxw2BJfc0wg7fC_-=o9uJ7w@mail.gmail.com>

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

Phillip

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

  reply	other threads:[~2024-09-18 10:05 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 [this message]
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
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=7b4ce2fc-3763-4881-8459-e0c1f2cbc69d@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mliberty@precisioninno.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.