diff options
| author | Dan Nicolaescu | 2009-07-23 05:17:27 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2009-07-23 05:17:27 +0000 |
| commit | 0a2ddfa6615afa2bb17ee5ac8811b2a7c91383bf (patch) | |
| tree | c5e4d787ce08e1f4f84d66f8ce5ad0bd1a0bf336 | |
| parent | 0badeef452b7fb61f3ea29edbc04cc9d2dcad9ba (diff) | |
| download | emacs-0a2ddfa6615afa2bb17ee5ac8811b2a7c91383bf.tar.gz emacs-0a2ddfa6615afa2bb17ee5ac8811b2a7c91383bf.zip | |
(vc-git-add-signoff): New variable.
(vc-git-checkin): Use it.
(vc-git-toggle-signoff): New function.
(vc-git-extra-menu-map): Bind it to menu.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/vc-git.el | 18 |
2 files changed, 24 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b227250e197..b0f249d105f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-07-22 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * vc-git.el (vc-git-add-signoff): New variable. | ||
| 4 | (vc-git-checkin): Use it. | ||
| 5 | (vc-git-toggle-signoff): New function. | ||
| 6 | (vc-git-extra-menu-map): Bind it to menu. | ||
| 7 | |||
| 1 | 2009-07-23 Glenn Morris <rgm@gnu.org> | 8 | 2009-07-23 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * help-fns.el (describe-variable): Describe ignored and risky local | 10 | * help-fns.el (describe-variable): Describe ignored and risky local |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 12441c8dc86..d8e9603cb4e 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -118,6 +118,13 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 118 | :version "23.1" | 118 | :version "23.1" |
| 119 | :group 'vc) | 119 | :group 'vc) |
| 120 | 120 | ||
| 121 | (defcustom vc-git-add-signoff nil | ||
| 122 | "Add a Signed-off-by line when committing." | ||
| 123 | :type 'boolean | ||
| 124 | :version "23.2" | ||
| 125 | :group 'vc) | ||
| 126 | |||
| 127 | |||
| 121 | (defvar git-commits-coding-system 'utf-8 | 128 | (defvar git-commits-coding-system 'utf-8 |
| 122 | "Default coding system for git commits.") | 129 | "Default coding system for git commits.") |
| 123 | 130 | ||
| @@ -420,7 +427,8 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 420 | 427 | ||
| 421 | (defun vc-git-checkin (files rev comment) | 428 | (defun vc-git-checkin (files rev comment) |
| 422 | (let ((coding-system-for-write git-commits-coding-system)) | 429 | (let ((coding-system-for-write git-commits-coding-system)) |
| 423 | (vc-git-command nil 0 files "commit" "-m" comment "--only" "--"))) | 430 | (vc-git-command nil 0 files "commit" |
| 431 | (if vc-git-add-signoff "-s" "") "-m" comment "--only" "--"))) | ||
| 424 | 432 | ||
| 425 | (defun vc-git-find-revision (file rev buffer) | 433 | (defun vc-git-find-revision (file rev buffer) |
| 426 | (let ((coding-system-for-read 'binary) | 434 | (let ((coding-system-for-read 'binary) |
| @@ -633,12 +641,20 @@ or BRANCH^ (where \"^\" can be repeated)." | |||
| 633 | (define-key map [git-grep] | 641 | (define-key map [git-grep] |
| 634 | '(menu-item "Git grep..." vc-git-grep | 642 | '(menu-item "Git grep..." vc-git-grep |
| 635 | :help "Run the `git grep' command")) | 643 | :help "Run the `git grep' command")) |
| 644 | (define-key map [git-sig] | ||
| 645 | '(menu-item "Add Signed-off-by on commit" vc-git-toggle-signoff | ||
| 646 | :help "Add Add Signed-off-by when commiting (i.e. add the -s flag)" | ||
| 647 | :button (:toggle . vc-git-add-signoff))) | ||
| 636 | map)) | 648 | map)) |
| 637 | 649 | ||
| 638 | (defun vc-git-extra-menu () vc-git-extra-menu-map) | 650 | (defun vc-git-extra-menu () vc-git-extra-menu-map) |
| 639 | 651 | ||
| 640 | (defun vc-git-extra-status-menu () vc-git-extra-menu-map) | 652 | (defun vc-git-extra-status-menu () vc-git-extra-menu-map) |
| 641 | 653 | ||
| 654 | (defun vc-git-toggle-signoff () | ||
| 655 | (interactive) | ||
| 656 | (setq vc-git-add-signoff (not vc-git-add-signoff))) | ||
| 657 | |||
| 642 | ;; Derived from `lgrep'. | 658 | ;; Derived from `lgrep'. |
| 643 | (defun vc-git-grep (regexp &optional files dir) | 659 | (defun vc-git-grep (regexp &optional files dir) |
| 644 | "Run git grep, searching for REGEXP in FILES in directory DIR. | 660 | "Run git grep, searching for REGEXP in FILES in directory DIR. |