]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
fixed git tag commit hook for magit 2.
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 11 Aug 2015 16:13:02 +0000 (18:13 +0200)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 11 Aug 2015 16:13:02 +0000 (18:13 +0200)
- magit-log-edit-mode-hook is gone. git-commit-mode-hook must be used now.

bba.org

diff --git a/bba.org b/bba.org
index 13fe2fea2654f051e1b29f18216b3220a61d28d7..8463aef9637d13c58456417f0e77dc52bdca78fd 100644 (file)
--- a/bba.org
+++ b/bba.org
@@ -176,12 +176,16 @@ For annotated tags prepare message with commit messages since last tag.
 #+BEGIN_SRC emacs-lisp
   (require 'magit)
   (setq magit-last-seen-setup-instructions "1.4.0")
-  (add-hook 'magit-log-edit-mode-hook
-            (lambda ()
-              (when (magit-log-edit-get-field 'tag-name)
+  (add-hook 'git-commit-mode-hook
+            (lambda()
+              (when (equal "TAG_EDITMSG" (buffer-name))
                 (progn
-                  (end-of-buffer)
-                (insert (shell-command-to-string "git log --pretty=format:\"* %s\" `git rev-list --tags --max-count=1`..HEAD" )))
+                  (insert (shell-command-to-string "git log --pretty=format:\"* %s\" `git rev-list --tags --max-count=1`..HEAD" ))
+                  (newline)
+                  (beginning-of-buffer)
+                  (newline)
+                  (beginning-of-buffer)
+                  )
                 )
               )
             )