emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103615: Add `vc-git-program' option;


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103615: Add `vc-git-program' option; suggested on emacs-devel.
Date: Thu, 10 Mar 2011 00:26:41 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103615
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2011-03-10 00:26:41 -0800
message:
  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.
modified:
  lisp/ChangeLog
  lisp/vc/vc-git.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-03-10 07:16:04 +0000
+++ b/lisp/ChangeLog    2011-03-10 08:26:41 +0000
@@ -1,5 +1,9 @@
 2011-03-10  Glenn Morris  <address@hidden>
 
+       * 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.
+
        * eshell/esh-util.el (eshell-condition-case): Doc fix.
 
        * cus-edit.el (Custom-newline): If no button at point, look

=== modified file 'lisp/vc/vc-git.el'
--- a/lisp/vc/vc-git.el 2011-02-14 01:49:24 +0000
+++ b/lisp/vc/vc-git.el 2011-03-10 08:26:41 +0000
@@ -119,6 +119,12 @@
   :version "23.1"
   :group 'vc)
 
+(defcustom vc-git-program "git"
+  "Name of the Git executable (excluding any arguments)."
+  :version "24.1"
+  :type 'string
+  :group 'vc)
+
 (defcustom vc-git-root-log-format
   '("%d%h..: %an %ad %s"
     ;; The first shy group matches the characters drawn by --graph.
@@ -554,7 +560,7 @@
   "Return the existing branches, as a list of strings.
 The car of the list is the current branch."
   (with-temp-buffer
-    (call-process "git" nil t nil "branch")
+    (call-process vc-git-program nil t nil "branch")
     (goto-char (point-min))
     (let (current-branch branches)
       (while (not (eobp))
@@ -633,13 +639,13 @@
   (let* ((root (vc-git-root default-directory))
         (buffer (format "*vc-git : %s*" (expand-file-name root)))
         (command "pull")
-        (git-program "git")
+        (git-program vc-git-program)
         args)
     ;; If necessary, prompt for the exact command.
     (when prompt
       (setq args (split-string
                  (read-shell-command "Git pull command: "
-                                     "git pull"
+                                      (format "%s pull" git-program)
                                      'vc-git-history)
                  " " t))
       (setq git-program (car  args)
@@ -663,7 +669,7 @@
                               branches
                             (cons "FETCH_HEAD" branches))
                           nil t)))
-    (apply 'vc-do-async-command buffer root "git" "merge"
+    (apply 'vc-do-async-command buffer root vc-git-program "merge"
           (list merge-source))
     (vc-set-async-update buffer)))
 
@@ -1083,8 +1089,10 @@
 
 (defun vc-git-command (buffer okstatus file-or-list &rest flags)
   "A wrapper around `vc-do-command' for use in vc-git.el.
-The difference to vc-do-command is that this function always invokes `git'."
-  (apply 'vc-do-command (or buffer "*vc*") okstatus "git" file-or-list flags))
+The difference to vc-do-command is that this function always invokes
+`vc-git-program'."
+  (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
+         file-or-list flags))
 
 (defun vc-git--empty-db-p ()
   "Check if the git db is empty (no commit done yet)."
@@ -1095,7 +1103,7 @@
   ;; We don't need to care the arguments.  If there is a file name, it
   ;; is always a relative one.  This works also for remote
   ;; directories.
-  (apply 'process-file "git" nil buffer nil command args))
+  (apply 'process-file vc-git-program nil buffer nil command args))
 
 (defun vc-git--out-ok (command &rest args)
   (zerop (apply 'vc-git--call '(t nil) command args)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]