{"action":"created","issue":{"url":"https://api.github.com/repos/magit/magit/issues/2246","labels_url":"https://api.github.com/repos/magit/magit/issues/2246/labels{/name}","comments_url":"https://api.github.com/repos/magit/magit/issues/2246/comments","events_url":"https://api.github.com/repos/magit/magit/issues/2246/events","html_url":"https://github.com/magit/magit/issues/2246","id":105350507,"number":2246,"title":"Magit no longer works with cygwin ?","user":{"login":"nchapon","id":472703,"avatar_url":"https://avatars.githubusercontent.com/u/472703?v=3","gravatar_id":"","url":"https://api.github.com/users/nchapon","html_url":"https://github.com/nchapon","followers_url":"https://api.github.com/users/nchapon/followers","following_url":"https://api.github.com/users/nchapon/following{/other_user}","gists_url":"https://api.github.com/users/nchapon/gists{/gist_id}","starred_url":"https://api.github.com/users/nchapon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchapon/subscriptions","organizations_url":"https://api.github.com/users/nchapon/orgs","repos_url":"https://api.github.com/users/nchapon/repos","events_url":"https://api.github.com/users/nchapon/events{/privacy}","received_events_url":"https://api.github.com/users/nchapon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magit/magit/labels/00%20bug%20windows","name":"00 bug windows","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":50,"created_at":"2015-09-08T10:37:12Z","updated_at":"2015-09-18T21:56:06Z","closed_at":null,"body":"It seems magit version 20150907.504 doesn't work with cygwin on windows \r\n\r\nWhen I try to open magit-buffer with magit-status command :\r\nmagit-insert-head-header: Wrong type argument: stringp, nil\r\n\r\nIt was working fine with previous versions (with magit 2.1.0). Did you change something concerning how git command is running ?\r\n\r\nThanks \r\n"},"comment":{"url":"https://api.github.com/repos/magit/magit/issues/comments/141577727","html_url":"https://github.com/magit/magit/issues/2246#issuecomment-141577727","issue_url":"https://api.github.com/repos/magit/magit/issues/2246","id":141577727,"user":{"login":"npostavs","id":287742,"avatar_url":"https://avatars.githubusercontent.com/u/287742?v=3","gravatar_id":"","url":"https://api.github.com/users/npostavs","html_url":"https://github.com/npostavs","followers_url":"https://api.github.com/users/npostavs/followers","following_url":"https://api.github.com/users/npostavs/following{/other_user}","gists_url":"https://api.github.com/users/npostavs/gists{/gist_id}","starred_url":"https://api.github.com/users/npostavs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npostavs/subscriptions","organizations_url":"https://api.github.com/users/npostavs/orgs","repos_url":"https://api.github.com/users/npostavs/repos","events_url":"https://api.github.com/users/npostavs/events{/privacy}","received_events_url":"https://api.github.com/users/npostavs/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T21:56:06Z","updated_at":"2015-09-18T21:56:06Z","body":"That still calls a process to check every time, if the option is set. I think we want something a bit more like\r\n\r\n```elisp\r\n(defvar magit-need-cygwin-noglob\r\n  (equal \"x0\\n\" (magit-git-string \"-c\" \"alias.echo=!echo\" \"echo\" \"x{0}\")))\r\n\r\n(defun magit-cygwin-env-vars ()\r\n  (when magit-need-cygwin-noglob\r\n    (mapcar (lambda (var)\r\n              (concat var \"=\" (--if-let (getenv var)\r\n                                  '(concat it \" noglob\")\r\n                                \"noglob\")))\r\n            '(\"CYGWIN\" \"MSYS\"))))\r\n\r\n(defun magit-process-file (&rest args)\r\n  (let ((process-environment (append (magit-cygwin-env-vars)\r\n                                     process-environment)))\r\n    (apply #'process-file args)))\r\n```"}}