Johannes Schindelin f4ac27566d git-wrapper: support COMSPEC better
The quoting rules of `cmd.exe` are really, really quirky. In particular,
if there are more than two quotes, the entire set of rules changes. That
is the reason why

	CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i

works, but

	CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh"

fails with this error message:

	'C:\Program' is not recognized as an internal or external command,
	operable program or batch file.

The recommended fix is to pass the /S option to `cmd.exe` and surround
the entire command-line by an extra set of quotes. And here lies the
rub: for that to work, we have to append an extra quote. At the end of
the command-line. *After* the last argument was appended, if any.

This commit supports that use case by introducing the option
"APPEND_QUOTE". The intended usage is to use the following string
resource:

	SHOW_CONSOLE=1 APPEND_QUOTE=1
	@@COMSPEC@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i

(Note that there are only three quotes on that command-line, the fourth
to be appended due to the `APPEND_QUOTE` setting.)

This is (1/3) to fix https://github.com/git-for-windows/git/issues/396

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-12-11 07:04:25 +01:00
2015-12-11 07:04:02 +01:00
2015-12-11 07:04:02 +01:00
2015-12-10 19:41:33 +01:00
2015-12-11 07:04:23 +01:00
2015-12-10 19:37:36 +01:00
2015-09-28 15:33:56 -07:00
2015-12-10 19:41:24 +01:00
2015-09-28 19:16:54 -07:00
2015-09-28 14:57:10 -07:00
2015-12-10 19:37:36 +01:00
2015-12-08 14:12:45 -08:00
2015-09-28 15:28:31 -07:00
2015-09-28 15:33:56 -07:00
2015-09-04 10:43:23 -07:00
2015-12-04 11:39:19 -08:00
2015-09-28 19:16:54 -07:00
2015-09-09 14:30:35 -07:00

Git for Windows

Join the chat at https://gitter.im/git-for-windows/git

This is the source code of Git for Windows, forked from Git.

This project is run by a governance model. If you encounter problems, you can report them as GitHub issues, discuss them on Git for Windows' Google Group, and contribute bug fixes.

Description
A fork of Git containing Windows-specific patches.
Readme 479 MiB
2025-08-19 03:50:05 -05:00
Languages
C 51.7%
Shell 37.5%
Perl 4.3%
Tcl 3%
Python 0.8%
Other 2.5%