20after4 has submitted this change and it was merged.

Change subject: Fix arcanist on windows
......................................................................


Fix arcanist on windows

Currently running arc on git for windows bash results in a proc_open
error, im not sure why or why it dosen't work.

Arcanist works in cmd but not in git for windows bash.

This is the error i get when running arc land from git for windows bash.

[2016-04-06 08:17:55] EXCEPTION: (Exception) Failed to passthru proc_open(): 
proc_open():
CreateProcess failed, error code - 87 at 
[<phutil>\src\future\exec\PhutilExecPassthru.php:99]
arcanist(), phutil()
  #0 PhutilExecPassthru::execute() called at 
[<phutil>\src\future\exec\execx.php:50]
  #1 phutil_passthru(string, string, string) called at 
[<arcanist>\src\repository\api\ArcanistGitAPI.php:46]
  #2 ArcanistGitAPI::execPassthru(string, string, string) called at 
[<arcanist>\src\land\ArcanistGitLandEngine.php:139]
  #3 ArcanistGitLandEngine::fetchTarget() called at 
[<arcanist>\src\land\ArcanistGitLandEngine.php:14]
  #4 ArcanistGitLandEngine::execute() called at 
[<arcanist>\src\workflow\ArcanistLandWorkflow.php:296]
  #5 ArcanistLandWorkflow::run() called at [<arcanist>\scripts\arcanist.php:392]

But with this patch it fixes it and arc works and lands the change.

Note: Thanks to @20after4 for helping me discover another way todo it.

Change-Id: I6ef262e058dc8f895b351b85b2f00830f74734fa
---
M src/repository/api/ArcanistGitAPI.php
1 file changed, 9 insertions(+), 5 deletions(-)

Approvals:
  20after4: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/repository/api/ArcanistGitAPI.php 
b/src/repository/api/ArcanistGitAPI.php
index 8600674..57a6f35 100644
--- a/src/repository/api/ArcanistGitAPI.php
+++ b/src/repository/api/ArcanistGitAPI.php
@@ -31,11 +31,15 @@
     static $git = null;
     if ($git === null) {
       if (phutil_is_windows()) {
-        // NOTE: On Windows, phutil_passthru() uses 'bypass_shell' because
-        // everything goes to hell if we don't. We must provide an absolute
-        // path to Git for this to work properly.
-        $git = Filesystem::resolveBinary('git');
-        $git = csprintf('%s', $git);
+        if (substr(getenv('SHELL'), -4) === 'bash') {
+          $git = 'git';
+        } else {
+          // NOTE: On Windows, phutil_passthru() uses 'bypass_shell' because
+          // everything goes to hell if we don't. We must provide an absolute
+          // path to Git for this to work properly.
+          $git = Filesystem::resolveBinary('git');
+          $git = csprintf('%s', $git);
+        }
       } else {
         $git = 'git';
       }

-- 
To view, visit https://gerrit.wikimedia.org/r/281955
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ef262e058dc8f895b351b85b2f00830f74734fa
Gerrit-PatchSet: 7
Gerrit-Project: phabricator/arcanist
Gerrit-Branch: stable
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: 20after4 <[email protected]>
Gerrit-Reviewer: Dereckson <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Luke081515 <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to