git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 4/5] git.el: Added support for Signed-off-by.
@ 2006-03-04 16:38 Alexandre Julliard
  2009-05-09 14:25 ` David Woodhouse
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Julliard @ 2006-03-04 16:38 UTC (permalink / raw
  To: git

If `git-append-signed-off-by' is non-nil, automatically append a
sign-off line to the log message when editing it.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

---

 contrib/emacs/git.el |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

00728d51cbda0f21be59cc56b23f4943c6657a63
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 335dcb2..0b24b4d 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -39,7 +39,6 @@
 ;;  - hook into file save (after-save-hook)
 ;;  - diff against other branch
 ;;  - renaming files from the status buffer
-;;  - support for appending signed-off-by
 ;;  - creating tags
 ;;  - fetch/pull
 ;;  - switching branches
@@ -103,6 +102,9 @@ If not set, fall back to `add-log-mailin
 (defvar git-commits-coding-system 'utf-8
   "Default coding system for git commits.")
 
+(defvar git-append-signed-off-by nil
+  "Whether to append a Signed-off-by line to the commit message.")
+
 (defconst git-log-msg-separator "--- log message follows this line ---")
 
 (defconst git-per-dir-ignore-file ".gitignore"
@@ -792,7 +794,8 @@ If not set, fall back to `add-log-mailin
   (unless git-status (error "Not in git-status buffer."))
   (let ((buffer (get-buffer-create "*git-commit*"))
         (merge-heads (git-get-merge-heads))
-        (dir default-directory))
+        (dir default-directory)
+        (sign-off git-append-signed-off-by))
     (with-current-buffer buffer
       (when (eq 0 (buffer-size))
         (cd dir)
@@ -809,10 +812,13 @@ If not set, fall back to `add-log-mailin
           'face 'git-header-face)
          (propertize git-log-msg-separator 'face 'git-separator-face)
          "\n")
-        (when (and merge-heads (file-readable-p ".git/MERGE_MSG"))
-          (insert-file-contents ".git/MERGE_MSG"))))
+        (cond ((and merge-heads (file-readable-p ".git/MERGE_MSG"))
+               (insert-file-contents ".git/MERGE_MSG"))
+              (sign-off
+               (insert (format "\n\nSigned-off-by: %s <%s>\n"
+                               (git-get-committer-name) (git-get-committer-email)))))))
     (let ((log-edit-font-lock-keywords
-           `(("^\\(Author:\\|Date:\\|Parent:\\)\\(.*\\)"
+           `(("^\\(Author:\\|Date:\\|Parent:\\|Signed-off-by:\\)\\(.*\\)"
               (1 font-lock-keyword-face)
               (2 font-lock-function-name-face))
              (,(concat "^\\(" (regexp-quote git-log-msg-separator) "\\)$")
-- 
1.2.4.g0040-dirty

-- 
Alexandre Julliard
julliard@winehq.org

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/5] git.el: Added support for Signed-off-by.
  2006-03-04 16:38 [PATCH 4/5] git.el: Added support for Signed-off-by Alexandre Julliard
@ 2009-05-09 14:25 ` David Woodhouse
  2009-05-09 19:57   ` Alexandre Julliard
  0 siblings, 1 reply; 3+ messages in thread
From: David Woodhouse @ 2009-05-09 14:25 UTC (permalink / raw
  To: Alexandre Julliard; +Cc: git

On Sat, 2006-03-04 at 17:38 +0100, Alexandre Julliard wrote:
> If `git-append-signed-off-by' is non-nil, automatically append a
> sign-off line to the log message when editing it.

This doesn't seem to work when I hit C-v v to commit. I just get an
empty *VC-log* buffer.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/5] git.el: Added support for Signed-off-by.
  2009-05-09 14:25 ` David Woodhouse
@ 2009-05-09 19:57   ` Alexandre Julliard
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Julliard @ 2009-05-09 19:57 UTC (permalink / raw
  To: David Woodhouse; +Cc: git

David Woodhouse <dwmw2@infradead.org> writes:

> On Sat, 2006-03-04 at 17:38 +0100, Alexandre Julliard wrote:
>> If `git-append-signed-off-by' is non-nil, automatically append a
>> sign-off line to the log message when editing it.
>
> This doesn't seem to work when I hit C-v v to commit. I just get an
> empty *VC-log* buffer.

C-v v doesn't use git.el, it uses the standard Emacs VC mode with the
vc-git backend. I don't think there's a clean way currently for a VC
backend to populate the log buffer, so if you want the auto sign off you
have to do the commit from the git-status buffer.

-- 
Alexandre Julliard
julliard@winehq.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-09 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-04 16:38 [PATCH 4/5] git.el: Added support for Signed-off-by Alexandre Julliard
2009-05-09 14:25 ` David Woodhouse
2009-05-09 19:57   ` Alexandre Julliard

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).