# [Git 2.22.0] git submodule foreach now requires quoted command?

3 messages from 2019-06-29 to 2019-07-02. Participants: Mateusz Loskot, Johannes Schindelin.
Thread: https://gitlist.dev/t/51407

## Mateusz Loskot, 2019-06-29 19:47

Subject: [Git 2.22.0] git submodule foreach now requires quoted command?
Message-ID: <CABUeae90FQnxS1FCZLo+5LgMPD9xWQv6w7p7ymCtLdBoOijcRw@mail.gmail.com>
URL: https://gitlist.dev/e/CABUeae90FQnxS1FCZLo%2B5LgMPD9xWQv6w7p7ymCtLdBoOijcRw%40mail.gmail.com

```
Hi,

I have a script which I have used for long time, with numerous
git commands and one of commands is this trivial:

git submodule foreach --recursive git clean -ffd

I updated to Git 2.22.0 and noticed Git started to complain:

ˋˋˋ
$ cd /d/boost
$ git submodule foreach --recursive git clean -ffd
Entering 'libs/accumulators'
error: unknown switch `f'
usage: git submodule--helper foreach [--quiet] [--recursive] [--] <command>

    -q, --quiet           Suppress output of entering each submodule command
    --recursive           Recurse into nested submodules

fatal: run_command returned non-zero status while recursing in the
nested submodules of libs/accumulators
ˋˋˋ

Apparently, I have to quote the command to avoid the error

git submodule foreach --recursive 'git clean -ffd'

Is this expected behaviour?
Could anyone help me to understand what has changed?
I can't find any related changes in the release notes.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

```

## Johannes Schindelin, 2019-07-01 12:34

Subject: Re: [Git 2.22.0] git submodule foreach now requires quoted command?
Message-ID: <nycvar.QRO.7.76.6.1907011433531.44@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1907011433531.44%40tvgsbejvaqbjf.bet
In-Reply-To: <CABUeae90FQnxS1FCZLo+5LgMPD9xWQv6w7p7ymCtLdBoOijcRw@mail.gmail.com>

```
Hi,

On Sat, 29 Jun 2019, Mateusz Loskot wrote:

> I have a script which I have used for long time, with numerous
> git commands and one of commands is this trivial:
>
> git submodule foreach --recursive git clean -ffd
>
> I updated to Git 2.22.0 and noticed Git started to complain:
>
> ˋˋˋ
> $ cd /d/boost
> $ git submodule foreach --recursive git clean -ffd
> Entering 'libs/accumulators'
> error: unknown switch `f'
> usage: git submodule--helper foreach [--quiet] [--recursive] [--] <command>
>
>     -q, --quiet           Suppress output of entering each submodule command
>     --recursive           Recurse into nested submodules
>
> fatal: run_command returned non-zero status while recursing in the
> nested submodules of libs/accumulators
> ˋˋˋ
>
> Apparently, I have to quote the command to avoid the error
>
> git submodule foreach --recursive 'git clean -ffd'
>
> Is this expected behaviour?
> Could anyone help me to understand what has changed?
> I can't find any related changes in the release notes.

Probably fixed in https://github.com/gitgitgadget/git/pull/263

Ciao,
Johannes

```

## Mateusz Loskot, 2019-07-02 19:11

Subject: Re: [Git 2.22.0] git submodule foreach now requires quoted command?
Message-ID: <CABUeae_NR43F+2-n9NPKUX_h2D+4nhbFT4UAaiBYFBrB5RyP7Q@mail.gmail.com>
URL: https://gitlist.dev/e/CABUeae_NR43F%2B2-n9NPKUX_h2D%2B4nhbFT4UAaiBYFBrB5RyP7Q%40mail.gmail.com
In-Reply-To: <nycvar.QRO.7.76.6.1907011433531.44@tvgsbejvaqbjf.bet>

```
On Mon, 1 Jul 2019 at 14:33, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> On Sat, 29 Jun 2019, Mateusz Loskot wrote:
>
> > I have a script which I have used for long time, with numerous
> > git commands and one of commands is this trivial:
> >
> > git submodule foreach --recursive git clean -ffd
> >
> > I updated to Git 2.22.0 and noticed Git started to complain:
> >
> > ˋˋˋ
> > $ cd /d/boost
> > $ git submodule foreach --recursive git clean -ffd
> > Entering 'libs/accumulators'
> > error: unknown switch `f'
> > usage: git submodule--helper foreach [--quiet] [--recursive] [--] <command>
> >
> >     -q, --quiet           Suppress output of entering each submodule command
> >     --recursive           Recurse into nested submodules
> >
> > fatal: run_command returned non-zero status while recursing in the
> > nested submodules of libs/accumulators
> > ˋˋˋ
> >
> > Apparently, I have to quote the command to avoid the error
> >
> > git submodule foreach --recursive 'git clean -ffd'
> >
> > Is this expected behaviour?
> > Could anyone help me to understand what has changed?
> > I can't find any related changes in the release notes.
>
> Probably fixed in https://github.com/gitgitgadget/git/pull/263


Johannes,

Thank you for the pointer.
It does seem related indeed.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

```
