Variable: magit-need-cygwin-noglob

magit-need-cygwin-noglob is a customizable variable defined in magit-process.el.

Value

nil

Documentation

Whether to use a workaround for Cygwin's globbing behavior.

If non-nil, add environment variables to process-environment to prevent the git.exe distributed by Cygwin and MSYS2 from attempting to perform glob expansion when called from a native Windows build of Emacs. See #2246.

This variable was added, or its default value changed, in magit version 2.3.0.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-process.el
(defcustom magit-need-cygwin-noglob
  (and (eq system-type 'windows-nt)
       (with-temp-buffer
         (let ((process-environment
                (append magit-git-environment process-environment)))
           (condition-case e
               (process-file magit-git-executable
                             nil (current-buffer) nil
                             "-c" "alias.echo=!echo" "echo" "x{0}")
             (file-error
              (lwarn 'magit-process :warning
                     "Could not run Git: %S" e))))
         (equal "x0\n" (buffer-string))))
  "Whether to use a workaround for Cygwin's globbing behavior.

If non-nil, add environment variables to `process-environment' to
prevent the git.exe distributed by Cygwin and MSYS2 from
attempting to perform glob expansion when called from a native
Windows build of Emacs.  See #2246."
  :package-version '(magit . "2.3.0")
  :group 'magit-process
  :type '(choice (const :tag "Yes" t)
                 (const :tag "No" nil)))