{"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":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2015-09-08T10:37:12Z","updated_at":"2015-09-13T02:55:49Z","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/139840774","html_url":"https://github.com/magit/magit/issues/2246#issuecomment-139840774","issue_url":"https://api.github.com/repos/magit/magit/issues/2246","id":139840774,"user":{"login":"johnmastro","id":836262,"avatar_url":"https://avatars.githubusercontent.com/u/836262?v=3","gravatar_id":"","url":"https://api.github.com/users/johnmastro","html_url":"https://github.com/johnmastro","followers_url":"https://api.github.com/users/johnmastro/followers","following_url":"https://api.github.com/users/johnmastro/following{/other_user}","gists_url":"https://api.github.com/users/johnmastro/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmastro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmastro/subscriptions","organizations_url":"https://api.github.com/users/johnmastro/orgs","repos_url":"https://api.github.com/users/johnmastro/repos","events_url":"https://api.github.com/users/johnmastro/events{/privacy}","received_events_url":"https://api.github.com/users/johnmastro/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T02:55:49Z","updated_at":"2015-09-13T02:55:49Z","body":"This is probably overkill, but we could also generalize this a bit and/or make it a no-op by default.\r\n\r\nI'm on the tired side and the below is untested by hopefully shows what I mean.\r\n\r\n```emacs-lisp\r\n;; nil by default?\r\n(defvar magit-process-environment-additions\r\n  '((\"CYGWIN\" \"noglob\")\r\n    (\"MSYS\"   \"noglob\")))\r\n\r\n(defmacro magit-with-process-environment (&rest body)\r\n  (declare (indent 0))\r\n  (let ((var-sym (make-symbol \"var\"))\r\n        (val-sym (make-symbol \"val\")))\r\n    `(let ((process-environment process-environment))\r\n       (pcase-dolist ((`(,,var-sym ,,val-sym)\r\n                       magit-process-environment-additions))\r\n         (setenv ,var-sym (--if-let (getenv ,var-sym)\r\n                              (concat it \" \" ,val-sym)\r\n                            ,val-sym)))\r\n       ,@body)))\r\n\r\n(defun magit-process-file (&rest args)\r\n  \"Process files synchronously in a separate process.\r\nIdentical to `process-file' but wrap the call with\r\n`magit-with-cygwin-noglob'.\"\r\n  (magit-with-process-environment (apply #'process-file args)))\r\n```"}}