aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/vc/vc-git.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/vc-git.el')
-rw-r--r--lisp/vc/vc-git.el22
1 files changed, 15 insertions, 7 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3b4d0e5f421..711a573ba99 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -119,6 +119,12 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
119 :version "23.1" 119 :version "23.1"
120 :group 'vc) 120 :group 'vc)
121 121
122(defcustom vc-git-program "git"
123 "Name of the Git executable (excluding any arguments)."
124 :version "24.1"
125 :type 'string
126 :group 'vc)
127
122(defcustom vc-git-root-log-format 128(defcustom vc-git-root-log-format
123 '("%d%h..: %an %ad %s" 129 '("%d%h..: %an %ad %s"
124 ;; The first shy group matches the characters drawn by --graph. 130 ;; The first shy group matches the characters drawn by --graph.
@@ -554,7 +560,7 @@ or an empty string if none."
554 "Return the existing branches, as a list of strings. 560 "Return the existing branches, as a list of strings.
555The car of the list is the current branch." 561The car of the list is the current branch."
556 (with-temp-buffer 562 (with-temp-buffer
557 (call-process "git" nil t nil "branch") 563 (call-process vc-git-program nil t nil "branch")
558 (goto-char (point-min)) 564 (goto-char (point-min))
559 (let (current-branch branches) 565 (let (current-branch branches)
560 (while (not (eobp)) 566 (while (not (eobp))
@@ -633,13 +639,13 @@ for the Git command to run."
633 (let* ((root (vc-git-root default-directory)) 639 (let* ((root (vc-git-root default-directory))
634 (buffer (format "*vc-git : %s*" (expand-file-name root))) 640 (buffer (format "*vc-git : %s*" (expand-file-name root)))
635 (command "pull") 641 (command "pull")
636 (git-program "git") 642 (git-program vc-git-program)
637 args) 643 args)
638 ;; If necessary, prompt for the exact command. 644 ;; If necessary, prompt for the exact command.
639 (when prompt 645 (when prompt
640 (setq args (split-string 646 (setq args (split-string
641 (read-shell-command "Git pull command: " 647 (read-shell-command "Git pull command: "
642 "git pull" 648 (format "%s pull" git-program)
643 'vc-git-history) 649 'vc-git-history)
644 " " t)) 650 " " t))
645 (setq git-program (car args) 651 (setq git-program (car args)
@@ -663,7 +669,7 @@ This prompts for a branch to merge from."
663 branches 669 branches
664 (cons "FETCH_HEAD" branches)) 670 (cons "FETCH_HEAD" branches))
665 nil t))) 671 nil t)))
666 (apply 'vc-do-async-command buffer root "git" "merge" 672 (apply 'vc-do-async-command buffer root vc-git-program "merge"
667 (list merge-source)) 673 (list merge-source))
668 (vc-set-async-update buffer))) 674 (vc-set-async-update buffer)))
669 675
@@ -1083,8 +1089,10 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
1083 1089
1084(defun vc-git-command (buffer okstatus file-or-list &rest flags) 1090(defun vc-git-command (buffer okstatus file-or-list &rest flags)
1085 "A wrapper around `vc-do-command' for use in vc-git.el. 1091 "A wrapper around `vc-do-command' for use in vc-git.el.
1086The difference to vc-do-command is that this function always invokes `git'." 1092The difference to vc-do-command is that this function always invokes
1087 (apply 'vc-do-command (or buffer "*vc*") okstatus "git" file-or-list flags)) 1093`vc-git-program'."
1094 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
1095 file-or-list flags))
1088 1096
1089(defun vc-git--empty-db-p () 1097(defun vc-git--empty-db-p ()
1090 "Check if the git db is empty (no commit done yet)." 1098 "Check if the git db is empty (no commit done yet)."
@@ -1095,7 +1103,7 @@ The difference to vc-do-command is that this function always invokes `git'."
1095 ;; We don't need to care the arguments. If there is a file name, it 1103 ;; We don't need to care the arguments. If there is a file name, it
1096 ;; is always a relative one. This works also for remote 1104 ;; is always a relative one. This works also for remote
1097 ;; directories. 1105 ;; directories.
1098 (apply 'process-file "git" nil buffer nil command args)) 1106 (apply 'process-file vc-git-program nil buffer nil command args))
1099 1107
1100(defun vc-git--out-ok (command &rest args) 1108(defun vc-git--out-ok (command &rest args)
1101 (zerop (apply 'vc-git--call '(t nil) command args))) 1109 (zerop (apply 'vc-git--call '(t nil) command args)))