* Re: [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd
2012-03-31 1:33 ` [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd Ben Walton
@ 2012-03-31 3:48 ` Jonathan Nieder
2012-03-31 5:38 ` Junio C Hamano
2012-03-31 5:55 ` Jonathan Nieder
2012-04-17 7:03 ` [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows Johannes Sixt
2 siblings, 1 reply; 16+ messages in thread
From: Jonathan Nieder @ 2012-03-31 3:48 UTC (permalink / raw)
To: Ben Walton; +Cc: peff, j.sixt, gitster, git
Ben Walton wrote:
> During the testing of the 1.7.10 rc series on Solaris for OpenCSW, it
> was discovered that t7006-pager was failing
[...]
> --- a/run-command.c
> +++ b/run-command.c
> @@ -4,6 +4,10 @@
> #include "sigchain.h"
> #include "argv-array.h"
>
> +#ifndef SHELL_PATH
> +# define SHELL_PATH "/bin/sh"
> +#endif
> +
> struct child_to_clean {
> pid_t pid;
> struct child_to_clean *next;
> @@ -90,7 +94,7 @@ static const char **prepare_shell_cmd(const char **argv)
> die("BUG: shell command is empty");
>
> if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
> - nargv[nargc++] = "sh";
> + nargv[nargc++] = SHELL_PATH;
The underlying problem is an old one. Thanks for fixing it.
For what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
[...]
> Essentially, the shell is a
> special case of tool that should not rely on SANE_TOOL_PATH and must
> be called explicitly.
It is probably annoying to hear me say this, but:
The above doesn't tell me _why_ it is a special case and that on
Solaris users have been burned by "sh" being the original Bourne shell
or a temperamental version of ksh so SHELL_PATH usually points to bash
or ksh93 instead.
I trust the reader enough to fill in the blank, though, so I think the
patch is ok as is.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd
2012-03-31 3:48 ` Jonathan Nieder
@ 2012-03-31 5:38 ` Junio C Hamano
0 siblings, 0 replies; 16+ messages in thread
From: Junio C Hamano @ 2012-03-31 5:38 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Ben Walton, peff, j.sixt, gitster, git
Jonathan Nieder <jrnieder@gmail.com> writes:
> Ben Walton wrote:
>
> The underlying problem is an old one. Thanks for fixing it.
>
> For what it's worth,
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks, all of you who participated in the review process.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd
2012-03-31 1:33 ` [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd Ben Walton
2012-03-31 3:48 ` Jonathan Nieder
@ 2012-03-31 5:55 ` Jonathan Nieder
2012-03-31 17:49 ` Junio C Hamano
2012-04-17 7:03 ` [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows Johannes Sixt
2 siblings, 1 reply; 16+ messages in thread
From: Jonathan Nieder @ 2012-03-31 5:55 UTC (permalink / raw)
To: Ben Walton; +Cc: peff, j.sixt, gitster, git
Ben Walton wrote:
> --- a/Makefile
> +++ b/Makefile
> @@ -1913,6 +1913,8 @@ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
> '-DGIT_MAN_PATH="$(mandir_SQ)"' \
> '-DGIT_INFO_PATH="$(infodir_SQ)"'
>
> +run-command.o: EXTRA_CPPFLAGS = -DSHELL_PATH='"$(SHELL_PATH_SQ)"'
Sorry I forgot to send this before. Quick tweaks:
- let assembler listings (from "make run-command.s") and sparse checks
reflect the SHELL_PATH setting, too
- the entire -DFOO="bar" argument is surrounded with single quotes
in other EXTRA_CPPFLAGS settings, so let this one follow that
pattern to avoid standing out
diff --git i/Makefile w/Makefile
index dea1f157..a3791139 100644
--- i/Makefile
+++ w/Makefile
@@ -1913,7 +1913,8 @@ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
'-DGIT_MAN_PATH="$(mandir_SQ)"' \
'-DGIT_INFO_PATH="$(infodir_SQ)"'
-run-command.o: EXTRA_CPPFLAGS = -DSHELL_PATH='"$(SHELL_PATH_SQ)"'
+run-command.sp run-command.s run-command.o: EXTRA_CPPFLAGS = \
+ '-DSHELL_PATH="$(SHELL_PATH_SQ)"'
$(BUILT_INS): git$X
$(QUIET_BUILT_IN)$(RM) $@ && \
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd
2012-03-31 5:55 ` Jonathan Nieder
@ 2012-03-31 17:49 ` Junio C Hamano
2012-03-31 18:04 ` Junio C Hamano
0 siblings, 1 reply; 16+ messages in thread
From: Junio C Hamano @ 2012-03-31 17:49 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Ben Walton, peff, j.sixt, gitster, git
Jonathan Nieder <jrnieder@gmail.com> writes:
> Sorry I forgot to send this before. Quick tweaks:
>
> - let assembler listings (from "make run-command.s") and sparse checks
> reflect the SHELL_PATH setting, too
>
> - the entire -DFOO="bar" argument is surrounded with single quotes
> in other EXTRA_CPPFLAGS settings, so let this one follow that
> pattern to avoid standing out
>
> diff --git i/Makefile w/Makefile
> index dea1f157..a3791139 100644
> --- i/Makefile
> +++ w/Makefile
> @@ -1913,7 +1913,8 @@ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
> '-DGIT_MAN_PATH="$(mandir_SQ)"' \
> '-DGIT_INFO_PATH="$(infodir_SQ)"'
>
> -run-command.o: EXTRA_CPPFLAGS = -DSHELL_PATH='"$(SHELL_PATH_SQ)"'
> +run-command.sp run-command.s run-command.o: EXTRA_CPPFLAGS = \
> + '-DSHELL_PATH="$(SHELL_PATH_SQ)"'
>
> $(BUILT_INS): git$X
> $(QUIET_BUILT_IN)$(RM) $@ && \
Actually, I do not think this is sufficient, and it happens that you and I
are the best position to realize it ;-).
Look at what is done in the Makefile for DEFAULT_EDITOR and DEFAULT_PAGER,
and compare with what the above is doing, and think why the EDITOR/PAGER
needs to have another level of quoting.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd
2012-03-31 17:49 ` Junio C Hamano
@ 2012-03-31 18:04 ` Junio C Hamano
0 siblings, 0 replies; 16+ messages in thread
From: Junio C Hamano @ 2012-03-31 18:04 UTC (permalink / raw)
To: Jonathan Nieder, Ben Walton; +Cc: peff, j.sixt, git
Junio C Hamano <gitster@pobox.com> writes:
> Jonathan Nieder <jrnieder@gmail.com> writes:
> ...
>> -run-command.o: EXTRA_CPPFLAGS = -DSHELL_PATH='"$(SHELL_PATH_SQ)"'
>> +run-command.sp run-command.s run-command.o: EXTRA_CPPFLAGS = \
>> + '-DSHELL_PATH="$(SHELL_PATH_SQ)"'
>>
>> $(BUILT_INS): git$X
>> $(QUIET_BUILT_IN)$(RM) $@ && \
>
> Actually, I do not think this is sufficient, and it happens that you and I
> are in the best position to realize it ;-).
>
> Look at what is done in the Makefile for DEFAULT_EDITOR and DEFAULT_PAGER,
> and compare with what the above is doing, and think why the EDITOR/PAGER
> needs to have another level of quoting.
In other words, something like this squashed into Ben's patch...
diff --git i/Makefile w/Makefile
index dea1f15..abee43e 100644
--- i/Makefile
+++ w/Makefile
@@ -1849,6 +1849,13 @@ DEFAULT_PAGER_CQ_SQ = $(subst ','\'',$(DEFAULT_PAGER_CQ))
BASIC_CFLAGS += -DDEFAULT_PAGER='$(DEFAULT_PAGER_CQ_SQ)'
endif
+ifdef SHELL_PATH
+SHELL_PATH_CQ = "$(subst ",\",$(subst \,\\,$(SHELL_PATH)))"
+SHELL_PATH_CQ_SQ = $(subst ','\'',$(SHELL_PATH_CQ))
+
+BASIC_CFLAGS += -DSHELL_PATH='$(SHELL_PATH_CQ_SQ)'
+endif
+
ALL_CFLAGS += $(BASIC_CFLAGS)
ALL_LDFLAGS += $(BASIC_LDFLAGS)
@@ -1913,8 +1920,6 @@ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
'-DGIT_MAN_PATH="$(mandir_SQ)"' \
'-DGIT_INFO_PATH="$(infodir_SQ)"'
-run-command.o: EXTRA_CPPFLAGS = -DSHELL_PATH='"$(SHELL_PATH_SQ)"'
-
$(BUILT_INS): git$X
$(QUIET_BUILT_IN)$(RM) $@ && \
ln git$X $@ 2>/dev/null || \
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-03-31 1:33 ` [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd Ben Walton
2012-03-31 3:48 ` Jonathan Nieder
2012-03-31 5:55 ` Jonathan Nieder
@ 2012-04-17 7:03 ` Johannes Sixt
2012-04-17 13:45 ` Ben Walton
2012-04-17 22:14 ` Jeff King
2 siblings, 2 replies; 16+ messages in thread
From: Johannes Sixt @ 2012-04-17 7:03 UTC (permalink / raw)
To: Ben Walton; +Cc: peff, jrnieder, gitster, git
From: Johannes Sixt <j6t@kdbg.org>
The recent change to use SHELL_PATH instead of "sh" to spawn shell commands
is not suited for Windows:
- The default setting, "/bin/sh", does not work when git has to run the
shell because it is a POSIX style path, but not a proper Windows style
path.
- If it worked, it would hard-code a position in the files system where
the shell is expected, making git (more precisely, the POSIX toolset that
is needed alongside git) non-relocatable. But we cannot sacrifice
relocatability on Windows.
- Apart from that, even though the Makefile leaves SHELL_PATH set to
"/bin/sh" for the Windows builds, the build system passes a mangled path
to the compiler, and something like "D:/Src/msysgit/bin/sh" is used,
which is doubly bad because it points to where /bin/sh resolves to on
the system where git was built.
- Finally, the system's CreateProcess() function that is used under
mingw.c's hood does not work with forward slashes and cannot find the
shell.
Undo the earlier change on Windows.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Am 3/31/2012 3:33, schrieb Ben Walton:
> +#ifndef SHELL_PATH
> +# define SHELL_PATH "/bin/sh"
> +#endif
> +
> struct child_to_clean {
> pid_t pid;
> struct child_to_clean *next;
> @@ -90,7 +94,7 @@ static const char **prepare_shell_cmd(const char **argv)
> die("BUG: shell command is empty");
>
> if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
> - nargv[nargc++] = "sh";
> + nargv[nargc++] = SHELL_PATH;
> nargv[nargc++] = "-c";
>
> if (argc < 2)
This looked so obviously correct, that I carelessly did not test the
change. But given that the first two points addressed in the commit
message above are actually dealbreakers, I should have noticed this issue
much earlier.
-- Hannes
run-command.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/run-command.c b/run-command.c
index 2af3e0f..e4edede 100644
--- a/run-command.c
+++ b/run-command.c
@@ -94,7 +94,11 @@ static const char **prepare_shell_cmd(const char **argv)
die("BUG: shell command is empty");
if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
+#ifndef WIN32
nargv[nargc++] = SHELL_PATH;
+#else
+ nargv[nargc++] = "sh";
+#endif
nargv[nargc++] = "-c";
if (argc < 2)
--
1.7.10.1370.ga6f62.dirty
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-17 7:03 ` [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows Johannes Sixt
@ 2012-04-17 13:45 ` Ben Walton
2012-04-17 14:00 ` Johannes Sixt
2012-04-17 22:14 ` Jeff King
1 sibling, 1 reply; 16+ messages in thread
From: Ben Walton @ 2012-04-17 13:45 UTC (permalink / raw)
To: Johannes Sixt; +Cc: peff, jrnieder, gitster, git
Excerpts from Johannes Sixt's message of Tue Apr 17 03:03:21 -0400 2012:
Hi Hannes,
> The recent change to use SHELL_PATH instead of "sh" to spawn shell
> commands is not suited for Windows:
Ah yes, I can see how that would be undesirable on Windows.
> +#ifndef WIN32
> nargv[nargc++] = SHELL_PATH;
> +#else
> + nargv[nargc++] = "sh";
> +#endif
> nargv[nargc++] = "-c";
A minor style question: Would this conditional code not be better if
it were up where the fallback SHELL_PATH is set? That would leave
this code block #ifdef free while still avoiding the breakage on
Windows.
Admittedly, it's a very minor point and possibly entirely a personal
preference.
Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-17 13:45 ` Ben Walton
@ 2012-04-17 14:00 ` Johannes Sixt
2012-04-17 14:04 ` Ben Walton
0 siblings, 1 reply; 16+ messages in thread
From: Johannes Sixt @ 2012-04-17 14:00 UTC (permalink / raw)
To: Ben Walton; +Cc: peff, jrnieder, gitster, git
Am 4/17/2012 15:45, schrieb Ben Walton:
> Excerpts from Johannes Sixt's message of Tue Apr 17 03:03:21 -0400 2012:
>> The recent change to use SHELL_PATH instead of "sh" to spawn shell
>> commands is not suited for Windows:
>
> Ah yes, I can see how that would be undesirable on Windows.
>
>> +#ifndef WIN32
>> nargv[nargc++] = SHELL_PATH;
>> +#else
>> + nargv[nargc++] = "sh";
>> +#endif
>> nargv[nargc++] = "-c";
>
> A minor style question: Would this conditional code not be better if
> it were up where the fallback SHELL_PATH is set? That would leave
> this code block #ifdef free while still avoiding the breakage on
> Windows.
It would require either to #define yet another new name to SHELL_PATH or
"sh", or to #undef SHELL_PATH and re#define it for WIN32. Neither is very
appealing. I personally prefer to have the conditional (if it is as short
as this one) at the point where it matters.
-- Hannes
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-17 14:00 ` Johannes Sixt
@ 2012-04-17 14:04 ` Ben Walton
0 siblings, 0 replies; 16+ messages in thread
From: Ben Walton @ 2012-04-17 14:04 UTC (permalink / raw)
To: Johannes Sixt; +Cc: peff, jrnieder, gitster, git
Excerpts from Johannes Sixt's message of Tue Apr 17 10:00:25 -0400 2012:
> It would require either to #define yet another new name to
> SHELL_PATH or "sh", or to #undef SHELL_PATH and re#define it for
> WIN32. Neither is very appealing. I personally prefer to have the
> conditional (if it is as short as this one) at the point where it
> matters.
Ok. I'll defer to your more experienced judgement. :) Thanks for
clarifying though.
Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-17 7:03 ` [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows Johannes Sixt
2012-04-17 13:45 ` Ben Walton
@ 2012-04-17 22:14 ` Jeff King
2012-04-18 5:39 ` Johannes Sixt
1 sibling, 1 reply; 16+ messages in thread
From: Jeff King @ 2012-04-17 22:14 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Ben Walton, jrnieder, gitster, git
On Tue, Apr 17, 2012 at 09:03:21AM +0200, Johannes Sixt wrote:
> diff --git a/run-command.c b/run-command.c
> index 2af3e0f..e4edede 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -94,7 +94,11 @@ static const char **prepare_shell_cmd(const char **argv)
> die("BUG: shell command is empty");
>
> if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
> +#ifndef WIN32
> nargv[nargc++] = SHELL_PATH;
> +#else
> + nargv[nargc++] = "sh";
> +#endif
> nargv[nargc++] = "-c";
>
> if (argc < 2)
It sounds like the real problem is not the use of a configurable shell,
but rather the use of an absolute path. Should you maybe try to pass the
basename of SHELL_PATH? Or maybe that is not even worth worrying about,
as somebody on Windows is not going to ever set SHELL_PATH, since it is
not like they are working around a non-POSIX "sh" included with the
operating system (which is why people on Solaris typically set
SHELL_PATH).
-Peff
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-17 22:14 ` Jeff King
@ 2012-04-18 5:39 ` Johannes Sixt
2012-04-18 7:27 ` Jeff King
2012-04-18 16:30 ` Junio C Hamano
0 siblings, 2 replies; 16+ messages in thread
From: Johannes Sixt @ 2012-04-18 5:39 UTC (permalink / raw)
To: Jeff King; +Cc: Ben Walton, jrnieder, gitster, git
Am 4/18/2012 0:14, schrieb Jeff King:
> On Tue, Apr 17, 2012 at 09:03:21AM +0200, Johannes Sixt wrote:
>
>> diff --git a/run-command.c b/run-command.c
>> index 2af3e0f..e4edede 100644
>> --- a/run-command.c
>> +++ b/run-command.c
>> @@ -94,7 +94,11 @@ static const char **prepare_shell_cmd(const char **argv)
>> die("BUG: shell command is empty");
>>
>> if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
>> +#ifndef WIN32
>> nargv[nargc++] = SHELL_PATH;
>> +#else
>> + nargv[nargc++] = "sh";
>> +#endif
>> nargv[nargc++] = "-c";
>>
>> if (argc < 2)
>
> It sounds like the real problem is not the use of a configurable shell,
> but rather the use of an absolute path. Should you maybe try to pass the
> basename of SHELL_PATH? Or maybe that is not even worth worrying about,
> as somebody on Windows is not going to ever set SHELL_PATH, since it is
> not like they are working around a non-POSIX "sh" included with the
> operating system (which is why people on Solaris typically set
> SHELL_PATH).
I thought about offering a customization point, but decided that it is not
worth the hassle: Most people download an installer, then the installer
can set up the PATH so that "sh" is not broken or something entirely
unrelated. And those who build git themselves know sufficiently well what
they are doing.
-- Hannes
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-18 5:39 ` Johannes Sixt
@ 2012-04-18 7:27 ` Jeff King
2012-04-18 16:30 ` Junio C Hamano
1 sibling, 0 replies; 16+ messages in thread
From: Jeff King @ 2012-04-18 7:27 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Ben Walton, jrnieder, gitster, git
On Wed, Apr 18, 2012 at 07:39:43AM +0200, Johannes Sixt wrote:
> > It sounds like the real problem is not the use of a configurable shell,
> > but rather the use of an absolute path. Should you maybe try to pass the
> > basename of SHELL_PATH? Or maybe that is not even worth worrying about,
> > as somebody on Windows is not going to ever set SHELL_PATH, since it is
> > not like they are working around a non-POSIX "sh" included with the
> > operating system (which is why people on Solaris typically set
> > SHELL_PATH).
>
> I thought about offering a customization point, but decided that it is not
> worth the hassle: Most people download an installer, then the installer
> can set up the PATH so that "sh" is not broken or something entirely
> unrelated. And those who build git themselves know sufficiently well what
> they are doing.
OK. I'll defer your judgement on what Windows users prefer. I just
wanted to make sure it was a conscious decision.
Other than that, the patch looks obviously correct to me. Thanks, and
sorry for inadvertently breaking git on windows (again). :)
-Peff
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-18 5:39 ` Johannes Sixt
2012-04-18 7:27 ` Jeff King
@ 2012-04-18 16:30 ` Junio C Hamano
2012-04-19 5:36 ` Johannes Sixt
1 sibling, 1 reply; 16+ messages in thread
From: Junio C Hamano @ 2012-04-18 16:30 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Jeff King, Ben Walton, jrnieder, gitster, git
Johannes Sixt <j.sixt@viscovery.net> writes:
>> It sounds like the real problem is not the use of a configurable shell,
>> but rather the use of an absolute path. Should you maybe try to pass the
>> basename of SHELL_PATH? ...
>
> I thought about offering a customization point, but decided that it is not
> worth the hassle...
I think you meant by the above that the installer could offer the user to
choose where to place the shell, and if that is the case, I agree it would
probably not worth it.
There is one thing I am confused about your response, though. I thought
the suggestion by Peff was to build your binary with "make SHELL_PATH=sh"
(not "make SHELL_PATH=/bin/sh"). I do not know if that works or does not
work (I do not see why not, though), but in either case offering a new
customization point sounds like a separate issue.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-18 16:30 ` Junio C Hamano
@ 2012-04-19 5:36 ` Johannes Sixt
2012-04-19 5:49 ` Junio C Hamano
0 siblings, 1 reply; 16+ messages in thread
From: Johannes Sixt @ 2012-04-19 5:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Ben Walton, jrnieder, git
Am 4/18/2012 18:30, schrieb Junio C Hamano:
> There is one thing I am confused about your response, though. I thought
> the suggestion by Peff was to build your binary with "make SHELL_PATH=sh"
> (not "make SHELL_PATH=/bin/sh"). I do not know if that works or does not
> work (I do not see why not, though), but in either case offering a new
> customization point sounds like a separate issue.
I tried this, and it does not work. (Shell scripts' shbang line would end
up as '#!sh', and at least bash does not like to run such scripts.)
The alternative is to customize the -DSHELL_PATH=... compiler option for
Windows, and that is primarily what I don't like: It would mean that
either the name "SHELL_PATH" has different meaning in C code and the
Makefile, or we need a new name for the C macro. (The latter would be "a
new customization point".)
I learn from this conversation that I should note failed alternatives more
frequently in the commit message to save reviewers' time.
-- Hannes
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows
2012-04-19 5:36 ` Johannes Sixt
@ 2012-04-19 5:49 ` Junio C Hamano
0 siblings, 0 replies; 16+ messages in thread
From: Junio C Hamano @ 2012-04-19 5:49 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Jeff King, Ben Walton, jrnieder, git
Johannes Sixt <j.sixt@viscovery.net> writes:
> Am 4/18/2012 18:30, schrieb Junio C Hamano:
>> There is one thing I am confused about your response, though. I thought
>> the suggestion by Peff was to build your binary with "make SHELL_PATH=sh"
>> (not "make SHELL_PATH=/bin/sh"). I do not know if that works or does not
>> work (I do not see why not, though), but in either case offering a new
>> customization point sounds like a separate issue.
>
> I tried this, and it does not work. (Shell scripts' shbang line would end
> up as '#!sh', and at least bash does not like to run such scripts.)
Ahh, sorry for missing the obvious. I should have realized about that
one, as customizing that one was the very original motivation of the make
variable.
In any case, as I wrote in the "What's cooking", I'll fast-track the fix
to 'master' shortly, so that Windows port does not have to carry it.
Thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread