[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 3af07129bc 09/10: magit-commit-diff: Remember c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 3af07129bc 09/10: magit-commit-diff: Remember commit command |
Date: |
Tue, 7 Jun 2022 10:58:26 -0400 (EDT) |
branch: elpa/git-commit
commit 3af07129bc0ca437ab46ced5400ed3288a0762e4
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-commit-diff: Remember commit command
---
lisp/git-commit.el | 3 +++
lisp/magit-commit.el | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index 883f082e04..c1a29f35bc 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -556,6 +556,9 @@ to recover older messages")
#'git-commit-save-message nil t)
(add-hook 'with-editor-pre-cancel-hook
#'git-commit-save-message nil t)
+ (when (fboundp 'magit-commit--reset-command)
+ (add-hook 'with-editor-post-finish-hook #'magit-commit--reset-command)
+ (add-hook 'with-editor-post-cancel-hook #'magit-commit--reset-command))
(when (and (fboundp 'magit-rev-parse)
(not (memq last-command
'(magit-sequencer-continue
diff --git a/lisp/magit-commit.el b/lisp/magit-commit.el
index 2bb0a166bd..1617f95d19 100644
--- a/lisp/magit-commit.el
+++ b/lisp/magit-commit.el
@@ -546,6 +546,7 @@ See `magit-commit-absorb' for an alternative
implementation."
;;; Pending Diff
(defun magit-commit-diff ()
+ (magit-repository-local-set 'this-commit-command last-command)
(when (and git-commit-mode magit-commit-show-diff)
(when-let ((diff-buffer (magit-get-mode-buffer 'magit-diff-mode)))
;; This window just started displaying the commit message
@@ -562,7 +563,7 @@ See `magit-commit-absorb' for an alternative
implementation."
(let ((rev nil)
(arg "--cached")
(msg nil))
- (pcase last-command
+ (pcase (magit-repository-local-get 'this-commit-command)
((guard (eq this-command 'magit-diff-while-committing))
(if-let ((diff-buf (magit-get-mode-buffer 'magit-diff-mode 'selected)))
(with-current-buffer diff-buf
@@ -605,6 +606,9 @@ See `magit-commit-absorb' for an alternative
implementation."
(add-to-list 'with-editor-server-window-alist
(cons git-commit-filename-regexp #'switch-to-buffer))
+(defun magit-commit--reset-command ()
+ (magit-repository-local-delete 'this-commit-command))
+
;;; Message Utilities
(defun magit-commit-message-buffer ()
- [nongnu] elpa/git-commit updated (9b48dd7e36 -> 2dfeaa6839), ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit e0abcbd22f 01/10: Change name of fake command used when adding --all argument, ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit e400987d1f 05/10: Remove outdated commit-diff comment, ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit 41b08daabf 08/10: magit-commit-diff-1: Determine arguments only here, ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit c0f4e43c58 02/10: magit-commit-diff: Fix name of a supported command, ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit f34913f669 06/10: magit-diff-refresh-buffer: Use nicer title while committing --all, ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit 3af07129bc 09/10: magit-commit-diff: Remember commit command,
ELPA Syncer <=
- [nongnu] elpa/git-commit 2dfeaa6839 10/10: magit-commit-diff-1: Use different heuristics, ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit 34365a2c5c 03/10: magit-commit-assert: Use --all instead of explicitly staging all, ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit c9a738f7d3 04/10: magit-commit-diff-1: New function, ELPA Syncer, 2022/06/07
- [nongnu] elpa/git-commit 3ebc4e84db 07/10: magit-diff-refresh-buffer: Fix magit-set-header-line-format, ELPA Syncer, 2022/06/07