;; install GNU zip's version of zcat.
(autoload 'Man-support-local-filenames "man")
+(autoload 'vc-responsible-backend "vc")
(defvar dired-guess-shell-alist-default
(list
'(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")))