Created
July 18, 2012 02:59
-
-
Save suhailshergill/3133855 to your computer and use it in GitHub Desktop.
magit: commit labels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun su/magit/commit-message-template (&rest discard) | |
"Have a template for the commit message" | |
(unless current-prefix-arg ;; ignore commit amends | |
(let ((tag (format "%s: " (magit-get-current-branch)))) | |
(goto-char (point-min)) | |
(unless (search-forward tag nil t) | |
(insert tag)) | |
(goto-char (point-max)) | |
))) | |
(add-hook 'magit-log-edit-mode-hook 'su/magit/commit-message-template) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment