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

[PATCH 3/3] add--interactive: fix external command invocation on Windows

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Sep 5, 2013, 03:40 UTC
Message-ID
<1378352440-25410-3-git-send-email-pclouds@gmail.com>
In-Reply-To
<1378352440-25410-1-git-send-email-pclouds@gmail.com>
From: Johannes Sixt <j6t@kdbg.org>

Back in 21e9757e (Hack git-add--interactive to make it work with ActiveState Perl, 2007-08-01), the invocation of external commands was changed to use qx{} on Windows. The rationale was that the command interpreter on Windows is not a POSIX shell, but rather Windows's CMD. That patch was wrong to include 'msys' in the check whether to use qx{} or not: 'msys' identifies MSYS perl as shipped with Git for Windows, which does not need the special treatment; qx{} should be used only with ActiveState perl, which is identified by 'MSWin32'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 git-add--interactive.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 75a991f..5156384 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -169,7 +169,7 @@ my %patch_modes = (
 my %patch_mode_flavour = %{$patch_modes{stage}};
 
 sub run_cmd_pipe {
-	if ($^O eq 'MSWin32' || $^O eq 'msys') {
+	if ($^O eq 'MSWin32') {
 		my @invalid = grep {m/[":*]/} @_;
 		die "$^O does not support: @invalid\n" if @invalid;
 		my @args = map { m/ /o ? "\"$_\"": $_ } @_;
-- 
1.8.2.83.gc99314b
Previous: Nguyễn Thái Ngọc DuyNext: Junio C Hamano
Message 3 of 4 in “pathspec: catch prepending :(prefix) on pathspec with short magic”
  1. 1/3 pathspec: catch prepending :(prefix) on pathspec with short magicNguyễn Thái Ngọc Duy, Sep 5, 2013
  2. 2/3 add: lift the pathspec magic restriction on "add -p"Nguyễn Thái Ngọc Duy, Sep 5, 2013
  3. 3/3 add--interactive: fix external command invocation on WindowsNguyễn Thái Ngọc Duy, Sep 5, 2013
  4. Junio C HamanoSep 5, 2013

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.