summaryrefslogtreecommitdiff
path: root/lisp/vc-git.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-07-23 05:17:27 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-07-23 05:17:27 +0000
commit0a2ddfa6615afa2bb17ee5ac8811b2a7c91383bf (patch)
treec5e4d787ce08e1f4f84d66f8ce5ad0bd1a0bf336 /lisp/vc-git.el
parent0badeef452b7fb61f3ea29edbc04cc9d2dcad9ba (diff)
downloademacs-0a2ddfa6615afa2bb17ee5ac8811b2a7c91383bf.tar.gz
(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.
Diffstat (limited to 'lisp/vc-git.el')
-rw-r--r--lisp/vc-git.el18
1 files changed, 17 insertions, 1 deletions
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."
:version "23.1"
:group 'vc)
+(defcustom vc-git-add-signoff nil
+ "Add a Signed-off-by line when committing."
+ :type 'boolean
+ :version "23.2"
+ :group 'vc)
+
+
(defvar git-commits-coding-system 'utf-8
"Default coding system for git commits.")
@@ -420,7 +427,8 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(defun vc-git-checkin (files rev comment)
(let ((coding-system-for-write git-commits-coding-system))
- (vc-git-command nil 0 files "commit" "-m" comment "--only" "--")))
+ (vc-git-command nil 0 files "commit"
+ (if vc-git-add-signoff "-s" "") "-m" comment "--only" "--")))
(defun vc-git-find-revision (file rev buffer)
(let ((coding-system-for-read 'binary)
@@ -633,12 +641,20 @@ or BRANCH^ (where \"^\" can be repeated)."
(define-key map [git-grep]
'(menu-item "Git grep..." vc-git-grep
:help "Run the `git grep' command"))
+ (define-key map [git-sig]
+ '(menu-item "Add Signed-off-by on commit" vc-git-toggle-signoff
+ :help "Add Add Signed-off-by when commiting (i.e. add the -s flag)"
+ :button (:toggle . vc-git-add-signoff)))
map))
(defun vc-git-extra-menu () vc-git-extra-menu-map)
(defun vc-git-extra-status-menu () vc-git-extra-menu-map)
+(defun vc-git-toggle-signoff ()
+ (interactive)
+ (setq vc-git-add-signoff (not vc-git-add-signoff)))
+
;; Derived from `lgrep'.
(defun vc-git-grep (regexp &optional files dir)
"Run git grep, searching for REGEXP in FILES in directory DIR.