git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG?] "git submodule foreach" when command is ssh

From
Chris Packham <judge.packham@gmail.com>
Date
Jan 5, 2011, 22:50 UTC
Message-ID
<AANLkTini=GaGSHDX4e1jhPVxKaSayUJoWa=w4u4Rz-+5@mail.gmail.com>
In-Reply-To
<AANLkTi=x2i6NvDNRzbszhk-a-z5AYe46-iUBxQsxJJHC@mail.gmail.com>
On Thu, Jan 6, 2011 at 11:32 AM, Chris Packham <judge.packham@gmail.com> wrote:
Show 20 quoted lines
> Hi All,
>
> I just noticed something odd with "git submodule foreach". I was
> running a script to create a backup of each submodule on a server I
> have ssh access to. I was surprised to find that git submodule foreach
> stopped silently after the first submodule.
>
> A little debugging and I find that
>
> git submodule foreach 'ssh localhost "ls /"' - stops silently after
> the first module (note that the command does produce the expected
> listing and there is no error about the command failing).
>
> git submodule foreach 'echo foo' - works as expected
>
> Any thoughts as to whats going on?
>
> ---
> git version 1.7.3.2
>

Actually this might be a ssh/bash bug (feature?). There is different behaviour between

  find . -maxdepth 1 -type d -a ! -name '\.*' | while read; do echo
$REPLY && ssh localhost ls /; done
and
  find . -maxdepth 1 -type d -a ! -name '\.*' | while read; do echo
$REPLY && ls /; done
Previous: Chris PackhamNext: Jeff King
Message 2 of 5 in “[BUG?] "git submodule foreach" when command is ssh”
  1. Chris PackhamJan 5, 2011
  2. Chris PackhamJan 5, 2011
  3. Jeff KingJan 5, 2011
  4. Chris PackhamJan 5, 2011
  5. Seth RobertsonJan 5, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.