diff options
| author | Glenn Morris | 2011-03-10 00:26:41 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-03-10 00:26:41 -0800 |
| commit | 02da65ff3a35a36e86419a3494286a1eba233e89 (patch) | |
| tree | 0a2e6a238a8f713c5fedfd59f6ef072cee6ed5cf | |
| parent | b2f603cc420af9f07bc9ce27b96256255009c506 (diff) | |
| download | emacs-02da65ff3a35a36e86419a3494286a1eba233e89.tar.gz emacs-02da65ff3a35a36e86419a3494286a1eba233e89.zip | |
Add `vc-git-program' option; suggested on emacs-devel.
* lisp/vc/vc-git.el (vc-git-program): New option.
(vc-git-branches, vc-git-pull, vc-git-merge-branch, vc-git-command)
(vc-git--call): Use it.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 22 |
2 files changed, 19 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0499954465a..c8890a926be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2011-03-10 Glenn Morris <rgm@gnu.org> | 1 | 2011-03-10 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * vc/vc-git.el (vc-git-program): New option. | ||
| 4 | (vc-git-branches, vc-git-pull, vc-git-merge-branch, vc-git-command) | ||
| 5 | (vc-git--call): Use it. | ||
| 6 | |||
| 3 | * eshell/esh-util.el (eshell-condition-case): Doc fix. | 7 | * eshell/esh-util.el (eshell-condition-case): Doc fix. |
| 4 | 8 | ||
| 5 | * cus-edit.el (Custom-newline): If no button at point, look | 9 | * cus-edit.el (Custom-newline): If no button at point, look |
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. |
| 555 | The car of the list is the current branch." | 561 | The 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. |
| 1086 | The difference to vc-do-command is that this function always invokes `git'." | 1092 | The 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))) |