author | Jeff King <peff@peff.net> | |
Wed, 30 Dec 2009 10:53:16 +0000 (05:53 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 2 Jan 2010 01:53:46 +0000 (17:53 -0800) | ||
commit | 8dba1e634af1d973a47fca616a63e7062a256790 | |
tree | 377f420098f214f106fddb395f7280c0336b48b9 | tree | snapshot |
parent | 902f235378cb2b2f6dd5dd664b9630c95321f0ae | commit | diff |
run-command: add "use shell" option
Many callsites run "sh -c $CMD" to run $CMD. We can make it
a little simpler for them by factoring out the munging of
argv.
For simple cases with no arguments, this doesn't help much, but:
1. For cases with arguments, we save the caller from
having to build the appropriate shell snippet.
2. We can later optimize to avoid the shell when
there are no metacharacters in the program.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Many callsites run "sh -c $CMD" to run $CMD. We can make it
a little simpler for them by factoring out the munging of
argv.
For simple cases with no arguments, this doesn't help much, but:
1. For cases with arguments, we save the caller from
having to build the appropriate shell snippet.
2. We can later optimize to avoid the shell when
there are no metacharacters in the program.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c | diff | blob | history | |
run-command.h | diff | blob | history |