diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-09-19 22:11:38 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-09-19 22:27:53 -0700 |
commit | 375a24d478150587a29e694259111bcf79ada5b2 (patch) | |
tree | d51863d2163e4a4d1fca5a5308c611b976cf0d2f /.emacs.d | |
parent | deb1376a80e0c1dfc5ad7e33cc82425083646d1e (diff) | |
download | dotfiles-375a24d478150587a29e694259111bcf79ada5b2.tar.gz |
spw/log-view-git-fixup: when there is *vc-log*, actually commit
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/init.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d6f363f6..a4e31267 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -3305,15 +3305,19 @@ mutt's review view, after exiting EDITOR." (defun spw/log-view-git-fixup () (interactive) - (let ((summary + (let ((project-root (project-root (project-current))) + (summary (format "Summary: fixup! %s\n\n" (cadr (process-lines "git" "rev-list" "--format=%s" (log-view-current-tag)))))) - (if (get-buffer "*vc-log*") + (if (and (get-buffer "*vc-log*") + (with-current-buffer "*vc-log*" + (file-equal-p project-root (project-root (project-current))))) (progn (pop-to-buffer "*vc-log*") (erase-buffer) - (insert summary ?\n ?\n)) + (insert summary ?\n ?\n) + (call-interactively #'log-edit-done)) (require 'log-edit) (log-edit-remember-comment summary) (message "Pushed fixup! commit summary to Log Edit comment ring")))) |