summaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-09-19 22:11:38 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-09-19 22:27:53 -0700
commit375a24d478150587a29e694259111bcf79ada5b2 (patch)
treed51863d2163e4a4d1fca5a5308c611b976cf0d2f /.emacs.d
parentdeb1376a80e0c1dfc5ad7e33cc82425083646d1e (diff)
downloaddotfiles-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.el10
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"))))