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

Re: Can dependency on /bin/sh be removed?

From
Jeff King <peff@peff.net>
Date
Jul 17, 2024, 05:53 UTC
Message-ID
<20240717055335.GC547635@coredump.intra.peff.net>
In-Reply-To
<87jzhlf2i4.fsf@igel.home>
On Tue, Jul 16, 2024 at 11:30:59PM +0200, Andreas Schwab wrote:
Show 9 quoted lines
> On Jul 16 2024, Jeff King wrote:
> 
> > Again, it's possible that we could detect that no shell metacharacters
> > are in play and do the word-splitting ourselves. But at that point I
> > think it should go into run-command's prepare_shell_cmd().
> 
> This is what GNU make does (see construct_command_argv_internal), for
> performance reason.  But run_command is probably not performance
> critical.

Thanks, that's interesting to hear. I agree that run_command is not usually performance critical. Generally if we find ourselves spawning a lot of processes, the right solution is to accomplish the same thing with fewer processes (or even in-process), not micro-optimize out the intermediate shell.

-Peff
Previous: Paul Smith
Message 12 of 12 in “Can dependency on /bin/sh be removed?”
  1. Scott MoserJul 15, 2024
  2. Junio C HamanoJul 15, 2024
  3. brian m. carlsonJul 15, 2024
  4. Jeff KingJul 15, 2024
  5. Scott MoserJul 16, 2024
  6. Junio C HamanoJul 16, 2024
  7. Jeff KingJul 16, 2024
  8. Junio C HamanoJul 16, 2024
  9. Jeff KingJul 17, 2024
  10. Andreas SchwabJul 16, 2024
  11. Paul SmithJul 16, 2024
  12. Jeff KingJul 17, 2024

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.