aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2010-04-09 08:35:30 -0700
committerDan Nicolaescu2010-04-09 08:35:30 -0700
commit6aebd58cd2355e7a92efe1a5ef90ec72dc370287 (patch)
treea13ea0c5d248960c767f83a8cada61823f594ce1
parentf6d90772166c3d59614cfc273fe766c579970a4a (diff)
downloademacs-6aebd58cd2355e7a92efe1a5ef90ec72dc370287.tar.gz
emacs-6aebd58cd2355e7a92efe1a5ef90ec72dc370287.zip
Add --author support to git commit.
* vc-git.el (vc-git-checkin): Pass extra-args to the commit command. (vc-git-log-edit-mode): New minor mode. (log-edit-mode, log-edit-extra-flags, log-edit-mode): New declarations.
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/vc-git.el21
3 files changed, 30 insertions, 3 deletions
diff --git a/etc/NEWS b/etc/NEWS
index a21f7967c2f..dadb92e0248 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -107,6 +107,10 @@ choose a color via list-colors-display.
107Author: NAME 107Author: NAME
108line will add "--author NAME" to the "bzr commit" command. 108line will add "--author NAME" to the "bzr commit" command.
109 109
110**** For Git, adding an
111Author: NAME
112line will add "--author NAME" to the "git commit" command.
113
110**** For Hg, adding an 114**** For Hg, adding an
111Author: NAME 115Author: NAME
112line will add "--user NAME" to the "hg commit" command. 116line will add "--user NAME" to the "hg commit" command.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 029db96d3ab..f4091aca9f4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12010-04-09 Dan Nicolaescu <dann@ics.uci.edu>
2
3 Add --author support to git commit.
4 * vc-git.el (vc-git-checkin): Pass extra-args to the commit command.
5 (vc-git-log-edit-mode): New minor mode.
6 (log-edit-mode, log-edit-extra-flags, log-edit-mode): New
7 declarations.
8
12010-04-09 Eric Raymond <esr@snark.thyrsus.com> 92010-04-09 Eric Raymond <esr@snark.thyrsus.com>
2 10
3 * vc-hooks.el, vc-git.el: Improve documentation comments. 11 * vc-hooks.el, vc-git.el: Improve documentation comments.
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index c1ca48a5b78..6010aa20b35 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -548,10 +548,10 @@ or an empty string if none."
548 (vc-git-command nil 0 file "rm" "-f" "--cached" "--")) 548 (vc-git-command nil 0 file "rm" "-f" "--cached" "--"))
549 549
550 550
551(defun vc-git-checkin (files rev comment &optional extra-args-ignored) 551(defun vc-git-checkin (files rev comment &optional extra-args)
552 (let ((coding-system-for-write git-commits-coding-system)) 552 (let ((coding-system-for-write git-commits-coding-system))
553 (vc-git-command nil 0 files "commit" 553 (apply 'vc-git-command nil 0 files
554 "-m" comment "--only" "--"))) 554 (nconc (list "commit" "-m" comment) extra-args (list "--only" "--")))))
555 555
556(defun vc-git-find-revision (file rev buffer) 556(defun vc-git-find-revision (file rev buffer)
557 (let* (process-file-side-effects 557 (let* (process-file-side-effects
@@ -790,6 +790,21 @@ or BRANCH^ (where \"^\" can be repeated)."
790 (progn (forward-line 1) (1- (point))))))))) 790 (progn (forward-line 1) (1- (point)))))))))
791 (or (vc-git-symbolic-commit next-rev) next-rev))) 791 (or (vc-git-symbolic-commit next-rev) next-rev)))
792 792
793(declare-function log-edit-mode "log-edit" ())
794(defvar log-edit-extra-flags)
795(defvar log-edit-before-checkin-process)
796
797(define-derived-mode vc-git-log-edit-mode log-edit-mode "Git-log-edit"
798 "Mode for editing Git commit logs.
799If a line like:
800Author: NAME
801is present in the log, it is removed, and
802--author=NAME
803is passed to the git commit command."
804 (set (make-local-variable 'log-edit-extra-flags) nil)
805 (set (make-local-variable 'log-edit-before-checkin-process)
806 '(("^Author:[ \t]+\\(.*\\)[ \t]*$" . (list "--author" (match-string 1))))))
807
793(defun vc-git-delete-file (file) 808(defun vc-git-delete-file (file)
794 (vc-git-command nil 0 file "rm" "-f" "--")) 809 (vc-git-command nil 0 file "rm" "-f" "--"))
795 810