Skip to content

Instantly share code, notes, and snippets.

@tommorris
Created December 21, 2021 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommorris/695e257c8c3c7345cb9196d4b67ed90c to your computer and use it in GitHub Desktop.
Save tommorris/695e257c8c3c7345cb9196d4b67ed90c to your computer and use it in GitHub Desktop.
A craptastic elisp function I wrote for inserting Git co-authored-by statements in Git commit messages in Emacs Evil mode
(defun add-git-coauthor-string (name email)
"Insert git coauthor string into commit message"
#'(lambda ()
(interactive)
(insert (format "Co-authored-by: %s <%s>" name email))
(message (format "Added coauthor: %s <%s>" name email))))
(setq colleagues '(
("JS" "Jean Smith" "jean.smith@yourcompany.com")
;; Add your frequent collaborators here
))
(dolist (colleague colleagues)
(evil-ex-define-cmd
(concat "Coauthor" (car colleague))
(apply 'add-git-coauthor-string (cdr colleague))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment