Commit bf276b79 authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/dired-x.el (dired-guess-shell-alist-default): Use git when possible.

Check for Git backend and provide "git apply" for patch files (bug#36895).
parent f986269f
Pipeline #2766 failed with stage
in 88 minutes and 58 seconds
......@@ -827,6 +827,7 @@ Also useful for `auto-mode-alist' like this:
;; install GNU zip's version of zcat.
(autoload 'Man-support-local-filenames "man")
(autoload 'vc-responsible-backend "vc")
(defvar dired-guess-shell-alist-default
......@@ -909,7 +910,10 @@ Also useful for `auto-mode-alist' like this:
'(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
" " dired-guess-shell-znew-switches))
'("\\.patch\\'" "cat * | patch")
(list "\\.patch\\'"
'(if (eq (ignore-errors (vc-responsible-backend default-directory)) 'Git)
"cat * | git apply"
"cat * | patch"))
(list "\\.patch\\.g?z\\'" "gunzip -qc * | patch"
;; Optional decompression.
'(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment