{"action":"created","issue":{"url":"https://api.github.com/repos/magit/magit/issues/2317","labels_url":"https://api.github.com/repos/magit/magit/issues/2317/labels{/name}","comments_url":"https://api.github.com/repos/magit/magit/issues/2317/comments","events_url":"https://api.github.com/repos/magit/magit/issues/2317/events","html_url":"https://github.com/magit/magit/issues/2317","id":109978395,"number":2317,"title":"magit use hard-coded mount prefix","user":{"login":"PierreTechoueyres","id":14978270,"avatar_url":"https://avatars.githubusercontent.com/u/14978270?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreTechoueyres","html_url":"https://github.com/PierreTechoueyres","followers_url":"https://api.github.com/users/PierreTechoueyres/followers","following_url":"https://api.github.com/users/PierreTechoueyres/following{/other_user}","gists_url":"https://api.github.com/users/PierreTechoueyres/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreTechoueyres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreTechoueyres/subscriptions","organizations_url":"https://api.github.com/users/PierreTechoueyres/orgs","repos_url":"https://api.github.com/users/PierreTechoueyres/repos","events_url":"https://api.github.com/users/PierreTechoueyres/events{/privacy}","received_events_url":"https://api.github.com/users/PierreTechoueyres/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magit/magit/labels/10%20feature%20request","name":"10 feature request","color":"079400"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-06T10:21:10Z","updated_at":"2015-10-06T15:35:42Z","closed_at":null,"body":"if an user customised the mount prefix in his cygwin / MINGW install, he is unable to use last magit version.\r\n\r\nIn function magit-expand-git-file-name (lisp/magit-git.el) the moun prefix is hard coded with cygdrive.\r\n\r\nhere is an attempt to fix this (this work for me with /mnt prefix) :\r\nSorry I was unable to attach it with a file.\r\n```text\r\n[PATCH] * lisp/magit-git.el magit-cygwin-prefix\r\n magit-expand-git-file-name\r\n\r\nUse `magit-cygwin-prefix' in `magit-expand-git-file-name' instead of\r\nhard-coded cygdrive prefix.\r\n---\r\n lisp/magit-git.el | 11 ++++++++++-\r\n 1 file changed, 10 insertions(+), 1 deletion(-)\r\n\r\ndiff --git a/lisp/magit-git.el b/lisp/magit-git.el\r\nindex 22327f6..add2739 100644\r\n--- a/lisp/magit-git.el\r\n+++ b/lisp/magit-git.el\r\n@@ -509,11 +509,20 @@ range.  Otherwise, it can be any revision or range accepted by\r\n         (setq pos (point)))\r\n       status)))\r\n \r\n+(defconst magit-cygwin-prefix\r\n+  (with-temp-buffer\r\n+    (call-process-shell-command \"mount -p | tail -1 | cut -d ' ' -f1\" nil t)\r\n+    (forward-line -1)\r\n+    (setq cygwin-prefix (buffer-substring-no-properties\r\n+                         (+ 1 (point)) (line-end-position)))))\r\n+\r\n (defun magit-expand-git-file-name (filename)\r\n   (unless (file-name-absolute-p filename)\r\n     (setq filename (expand-file-name filename)))\r\n   (if (and (eq system-type 'windows-nt) ; together with cygwin git, see #1318\r\n-           (string-match \"^/\\\\(cygdrive/\\\\)?\\\\([a-z]\\\\)/\\\\(.*\\\\)\" filename))\r\n+           (string-match\r\n+            (concat \"^/\\\\(\" magit-cygwin-prefix \"/\\\\)?\\\\([a-z]\\\\)/\\\\(.*\\\\)\")\r\n+            filename))\r\n       (concat (match-string 2 filename) \":/\"\r\n               (match-string 3 filename))\r\n     filename))\r\n-- \r\n2.5.2\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/magit/magit/issues/comments/145903212","html_url":"https://github.com/magit/magit/issues/2317#issuecomment-145903212","issue_url":"https://api.github.com/repos/magit/magit/issues/2317","id":145903212,"user":{"login":"PierreTechoueyres","id":14978270,"avatar_url":"https://avatars.githubusercontent.com/u/14978270?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreTechoueyres","html_url":"https://github.com/PierreTechoueyres","followers_url":"https://api.github.com/users/PierreTechoueyres/followers","following_url":"https://api.github.com/users/PierreTechoueyres/following{/other_user}","gists_url":"https://api.github.com/users/PierreTechoueyres/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreTechoueyres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreTechoueyres/subscriptions","organizations_url":"https://api.github.com/users/PierreTechoueyres/orgs","repos_url":"https://api.github.com/users/PierreTechoueyres/repos","events_url":"https://api.github.com/users/PierreTechoueyres/events{/privacy}","received_events_url":"https://api.github.com/users/PierreTechoueyres/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T15:35:42Z","updated_at":"2015-10-06T15:35:42Z","body":"I guess yes\r\n\r\n```text\r\n mount --help                                                                                                                 ~\r\nUsage: mount [OPTION] [<win32path> <posixpath>]\r\n       mount -a\r\n       mount <posixpath>\r\n\r\nDisplay information about mounted filesystems, or mount a filesystem\r\n\r\n  -a, --all                     mount all filesystems mentioned in fstab\r\n  -c, --change-cygdrive-prefix  change the cygdrive path prefix to <posixpath>\r\n  -f, --force                   force mount, don't warn about missing mount\r\n                                point directories\r\n  -h, --help                    output usage information and exit\r\n  -m, --mount-entries           write fstab entries to replicate mount points\r\n                                and cygdrive prefixes\r\n  -o, --options X[,X...]        specify mount options\r\n  -p, --show-cygdrive-prefix    show user and/or system cygdrive path prefix\r\n  -V, --version                 output version information and exit\r\n\r\nValid options are: acl,auto,binary,bind,cygexec,dos,exec,ihash,noacl,nosuid,notexec,nouser,override,posix=0,posix=1,sparse,text,user\r\n```\r\n\r\nand\r\n```text\r\nmount -p                                                                                                                     ~\r\nPrefix              Type         Flags\r\n/mnt                user         binmode\r\n```\r\n\r\nso \r\n```text\r\n mount -p | tail -1 | cut -d ' ' -f 1                                                                                         ~\r\n/mnt\r\n```\r\nobviously the tail and cut can be achieved in elisp with something like\r\n```elisp\r\n(forward-line -1)\r\n(buffer-substring-no-properties (+ 1 (point)) (line-end-position))\r\n```\r\n"}}