aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-09-03 14:28:06 -0400
committerStefan Monnier2013-09-03 14:28:06 -0400
commit724f5e41b6997252209ae3c0f2d04f3d5107b38c (patch)
treeaf5dc32ef59d71b1419127df0043bc9320657971
parent14b511d4e562f5f15d4f3133be9bea7a1077ef70 (diff)
downloademacs-724f5e41b6997252209ae3c0f2d04f3d5107b38c.tar.gz
emacs-724f5e41b6997252209ae3c0f2d04f3d5107b38c.zip
* lisp/vc/vc-git.el (vc-git-checkin): Make it possible to commit a merge.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/vc/vc-git.el13
2 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d71087f8302..ad5baad3ef0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12013-09-03 Stefan Monnier <monnier@iro.umontreal.ca> 12013-09-03 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * vc/vc-git.el (vc-git-checkin): Make it possible to commit a merge.
4
3 * emacs-lisp/package.el (package-activate-1): Don't let a missing 5 * emacs-lisp/package.el (package-activate-1): Don't let a missing
4 <pkg>-autoloads.el file stop us. 6 <pkg>-autoloads.el file stop us.
5 7
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 472c42840af..e37bfe75dfa 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -649,11 +649,18 @@ If toggling on, also insert its message into the buffer."
649It is based on `log-edit-mode', and has Git-specific extensions.") 649It is based on `log-edit-mode', and has Git-specific extensions.")
650 650
651(defun vc-git-checkin (files _rev comment) 651(defun vc-git-checkin (files _rev comment)
652 (let ((coding-system-for-write vc-git-commits-coding-system)) 652 (let* ((file1 (or (car files) default-directory))
653 (root (vc-git-root file1))
654 (default-directory (expand-file-name root))
655 (only (or (cdr files)
656 (not (equal root (abbreviate-file-name file1)))))
657 (coding-system-for-write vc-git-commits-coding-system))
653 (cl-flet ((boolean-arg-fn 658 (cl-flet ((boolean-arg-fn
654 (argument) 659 (argument)
655 (lambda (value) (when (equal value "yes") (list argument))))) 660 (lambda (value) (when (equal value "yes") (list argument)))))
656 (apply 'vc-git-command nil 0 files 661 ;; When operating on the whole tree, better pass nil than ".", since "."
662 ;; fails when we're committing a merge.
663 (apply 'vc-git-command nil 0 (if only files)
657 (nconc (list "commit" "-m") 664 (nconc (list "commit" "-m")
658 (log-edit-extract-headers 665 (log-edit-extract-headers
659 `(("Author" . "--author") 666 `(("Author" . "--author")
@@ -661,7 +668,7 @@ It is based on `log-edit-mode', and has Git-specific extensions.")
661 ("Amend" . ,(boolean-arg-fn "--amend")) 668 ("Amend" . ,(boolean-arg-fn "--amend"))
662 ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) 669 ("Sign-Off" . ,(boolean-arg-fn "--signoff")))
663 comment) 670 comment)
664 (list "--only" "--")))))) 671 (if only (list "--only" "--")))))))
665 672
666(defun vc-git-find-revision (file rev buffer) 673(defun vc-git-find-revision (file rev buffer)
667 (let* (process-file-side-effects 674 (let* (process-file-side-effects