Re: [PATCH] Use SHELL_PATH to fork commands in run_command.c:prepare_shell_cmd
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 27, 2012, 05:01 UTC
- Message-ID
- <20120327050109.GC22547@burratino>
- In-Reply-To
- <20120327032917.GB17338@sigill.intra.peff.net>
Jeff King wrote:
Show 6 quoted lines
> Does this default ever kick in? The Makefile defaults SHELL_PATH to > /bin/sh, so we will always end up with at least that. > > Doing so at least makes us consistent across builds, but I wonder if we > should leave it as "sh" on systems that do not set SHELL_PATH manually. > Executing "sh" via the PATH is the normal system() thing to do.
It's more common for system() to default to /bin/sh.
I noticed the Makefile already doesn't do this sort of thing for mandir and htmldir, but do you think changes to SHELL_PATH should be tracked to force a rebuild when it changes?
GIT-SHELL-PATH: FORCE @FLAGS='$(SHELL_PATH_SQ)'; \ if test x"$$FLAGS" != x"`cat GIT-SHELL-PATH 2>/dev/null`" ; then \ echo 1>&2 " * new shell path"; \ echo "$$FLAGS" >GIT-SHELL-PATH; \ fi
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh GIT-SHELL-PATH ...
$(SCRIPT_LIB) : % : %.sh GIT-SHELL-PATH ...
run_command.sp run_command.o: GIT-SHELL-PATH exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \ '-DSHELL_PATH="$(SHELL_PATH_SQ)"'