Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git submodule foreach --recursive no longer works properly #2230

Closed
1 task done
jesterKing opened this issue Jun 13, 2019 · 3 comments
Closed
1 task done

git submodule foreach --recursive no longer works properly #2230

jesterKing opened this issue Jun 13, 2019 · 3 comments

Comments

@jesterKing
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.22.0.windows.1
cpu: x86_64
built from commit: d003d728ffa6c0006da875ec6318d3f6b28a4ddb
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.18362.116]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
Enable Builtin Interactive Add: Disabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

N/A

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash, CMD

git submodule foreach --recursive git clean -dxff
  • What did you expect to occur after running these commands?

Proper running of the git clean -dxff command for each submodule

  • What actually happened instead?

Error message

$ git submodule foreach --recursive git clean -dxff
Entering 'src/lib/opennurbs'
error: unknown switch `d'
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 src/lib/opennurbs
.
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Happens with all repositories tested.

  • Additional note

The command works with the form git submodule foreach --recursive "git clean -dxff", but that seems to be an undocumented change from git version 2.21.0.windows.1, where the form git submodule foreach --recursive git clean -dxff still worked as expected.

@rimrul
Copy link
Member

rimrul commented Jun 13, 2019

It seems this was caused in upstream git in commit a282f5a. A fix seems to be in the in the making.

@dscho
Copy link
Member

dscho commented Jul 1, 2019

It entered next already as git@30db18b, which means that it is on track to be included in the next major version of Git.

@jesterKing feel free to install Git for Windows' SDK, then build an initial Git with sdk build git, then sdk cd git and cherry-pick this fix, then test, and open a PR.

(If this is too dense an explanation how to continue, please do not hesitate to ask for help.)

@rimrul
Copy link
Member

rimrul commented Feb 6, 2021

The fix made it into git v2.22.1 and newer, so I'll assume this is working now.

@rimrul rimrul closed this as completed Feb 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants