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

Re: [PATCH] git submodule foreach: Skip eval for more than one argument

From
Matthijs Kooijman <matthijs@stdin.nl>
Date
Mar 4, 2014, 14:57 UTC
Message-ID
<20140304145703.GE11566@login.drsnuggles.stderr.nl>
In-Reply-To
<CALKQrgfC1Cf=ZnwhaDUz-2q=vLa0UbO4ONybvCPu7RiF+3sm3w@mail.gmail.com>
On Tue, Mar 04, 2014 at 03:53:24PM +0100, Johan Herland wrote:
Show 9 quoted lines
> On Tue, Mar 4, 2014 at 2:51 PM, Matthijs Kooijman <matthijs@stdin.nl> wrote:
> > matthijs@grubby:~/test$ git submodule foreach echo '$name'
> > Entering 'test'
> > $name
> 
> jherland@beta ~/test$ echo '$name'
> $name
> 
> What would you expect echo '$name' to do?

If I run git submodule foreach each '$name', then my shell eats the single quotes (which are only to prevent my shell from interpreting $name). git submodule will see $name, so it will run echo $name, not echo '$name'.

> What happens if you use double instead of single quotes?

Then my shell eats up the double quotes _and_ replaces $name with nothing, so I can't expect git submodule to replace it with the submodule name then :-)

Does that help to clarify what I mean?
Gr.
Matthijs
Previous: Johan HerlandNext: Johan Herland
Message 7 of 9 in “git submodule foreach: Skip eval for more than one argument”
  1. git submodule foreach: Skip eval for more than one argumentAnders Kaseorg, Sep 26, 2013
  2. Johan HerlandSep 27, 2013
  3. git submodule foreach: Skip eval for more than one argumentAnders Kaseorg, Sep 27, 2013
  4. Johan HerlandSep 27, 2013
  5. Matthijs KooijmanMar 4, 2014
  6. Johan HerlandMar 4, 2014
  7. Matthijs KooijmanMar 4, 2014
  8. Johan HerlandMar 4, 2014
  9. Matthijs KooijmanMar 4, 2014

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.