diff options
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/vc-git.el | 21 |
3 files changed, 30 insertions, 3 deletions
| @@ -107,6 +107,10 @@ choose a color via list-colors-display. | |||
| 107 | Author: NAME | 107 | Author: NAME |
| 108 | line will add "--author NAME" to the "bzr commit" command. | 108 | line will add "--author NAME" to the "bzr commit" command. |
| 109 | 109 | ||
| 110 | **** For Git, adding an | ||
| 111 | Author: NAME | ||
| 112 | line will add "--author NAME" to the "git commit" command. | ||
| 113 | |||
| 110 | **** For Hg, adding an | 114 | **** For Hg, adding an |
| 111 | Author: NAME | 115 | Author: NAME |
| 112 | line will add "--user NAME" to the "hg commit" command. | 116 | line 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 @@ | |||
| 1 | 2010-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 | |||
| 1 | 2010-04-09 Eric Raymond <esr@snark.thyrsus.com> | 9 | 2010-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. | ||
| 799 | If a line like: | ||
| 800 | Author: NAME | ||
| 801 | is present in the log, it is removed, and | ||
| 802 | --author=NAME | ||
| 803 | is 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 | ||