threads / discuss / 51407

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

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

## tl;dr

3 messages between Jun 29, 2019 and Jul 2, 2019.

replies: 2people: 2as markdown or json

Mateusz Loskot· Jun 29, 2019, 19:47 UTC · lore
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· Jul 1, 2019, 12:34 UTC · re: Mateusz Loskot · lore

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

Hi,
On Sat, 29 Jun 2019, Mateusz Loskot wrote:
Show 28 quoted lines
> 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· Jul 2, 2019, 19:11 UTC · re: Johannes Schindelin · lore

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

On Mon, 1 Jul 2019 at 14:33, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 32 quoted lines
> 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

← back to recent threads