[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate dce39b452c 63/67: Make agitate-vc-git-kill-comm
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate dce39b452c 63/67: Make agitate-vc-git-kill-commit-message use completion |
Date: |
Wed, 28 Sep 2022 16:57:30 -0400 (EDT) |
branch: externals/agitate
commit dce39b452cefbe6bb719a9ae4a89f2657026070a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make agitate-vc-git-kill-commit-message use completion
---
README.org | 8 ++++----
agitate.el | 28 ++++++++++++++++++++--------
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/README.org b/README.org
index a2149f0584..74d4b68371 100644
--- a/README.org
+++ b/README.org
@@ -179,10 +179,10 @@ commits" are documented here:
<https://www.conventionalcommits.org/en/v1.0.0/>.
#+findex: agitate-vc-git-kill-commit-message
+ ~agitate-vc-git-kill-commit-message~ :: Append to ~kill-ring~
- message of commit with =HASH= identifier. Prompt for =HASH= as a
- string. When point is in a log-view buffer, make the revision at
- point the default value of the prompt. This is useful to quote a
- past commit message.
+ message of commit with HASH identifier. q When called interactively,
+ prompt for =HASH= using minibuffer completion. When point is in a
+ log-view buffer, make the revision at point the default value of the
+ prompt. This is useful to quote a past commit message.
#+findex: agitate-vc-git-push-prompt-for-remote
+ ~agitate-vc-git-push-prompt-for-remote~ :: Behave like ~vc-git-push~
diff --git a/agitate.el b/agitate.el
index 164d0fae73..51f2f3df8c 100644
--- a/agitate.el
+++ b/agitate.el
@@ -326,22 +326,34 @@ arguments."
(defun agitate--vc-git-kill-commit-message-prompt ()
"Helper prompt for `agitate-vc-git-kill-commit-message'."
- (if-let ((default-value (cadr (log-view-current-entry (point) t))))
- (read-string (format "Commit HASH [%s]: " default-value)
- nil 'agitate--vc-git-kill-commit-message-history
default-value)
- (read-string "Commit HASH: " nil
'agitate--vc-git-kill-commit-message-history)))
+ (let* ((default-value (cadr (log-view-current-entry (point) t)))
+ (prompt (if default-value
+ (format "Commit HASH [%s]: " default-value)
+ "Commit HASH: "))
+ (default-directory (vc-root-dir)))
+ (completing-read
+ prompt
+ (process-lines vc-git-program "log" "--oneline" "--")
+ nil t nil
+ 'agitate--vc-git-kill-commit-message-history default-value)))
;;;###autoload
(defun agitate-vc-git-kill-commit-message (hash)
"Append to `kill-ring' message of commit with HASH identifier.
-Prompt for HASH as a string. When point is in a log-view buffer,
-make the revision at point the default value of the prompt.
+When called interactively, prompt for HASH using minibuffer
+completion.
+
+When point is in a log-view buffer, make the revision at point
+the default value of the prompt.
This is useful to quote a past commit message."
- (interactive (list (agitate--vc-git-kill-commit-message-prompt)))
+ (interactive
+ (list
+ (agitate--vc-git-get-hash-from-string
+ (agitate--vc-git-kill-commit-message-prompt))))
(kill-new
(with-temp-buffer
- (apply 'vc-git-command t nil nil (list "log" hash "-1" "--stat"
"--no-color" "--"))
+ (apply 'vc-git-command t nil nil (list "show" hash "--stat" "--no-color"
"--"))
(buffer-substring-no-properties (point-min) (point-max))))
(message "Added %s commit message to `kill-ring'" hash))
- [elpa] externals/agitate 4ed8d553ba 22/67: Record TODO for vc-git-push replacements, (continued)
- [elpa] externals/agitate 4ed8d553ba 22/67: Record TODO for vc-git-push replacements, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate bb94713469 40/67: Fix formatting of inline code in the manual, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 475b75a91a 26/67: Add skeleton of README.org, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate cbe4eed8b2 23/67: Add agitate-log-edit-emoji-commit command+option, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate c54fe94ac1 55/67: Add agitate-vc-git-prompt-format-patch-single cmd, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 6c89d23954 47/67: Remove agitate-diff-kill-dwim (doesn't work), ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 91e685d0fb 37/67: Add dir-locals.el, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate a5ee057fd5 65/67: Add sample configuration to the manual, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 052d3e3570 61/67: Simplify agitate--vc-git-commit-prompt, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 51fd96aba6 56/67: Tweak format of quote in the README.org, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate dce39b452c 63/67: Make agitate-vc-git-kill-commit-message use completion,
ELPA Syncer <=
- [elpa] externals/agitate da4a2bb77a 34/67: Update agitate.el headers and Commentary, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 7564713208 29/67: Rewrite outline heading for diffs, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate f736eb51a7 67/67: Tweak markup of "git-grep(1)", ELPA Syncer, 2022/09/28
- [elpa] externals/agitate b6e5cdbdda 14/67: Add agitate-enable-outline-minor-mode function, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate d1de59188d 08/67: Set minimum Emacs to 28.1, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 764644c218 15/67: Use 'length>' again since b6e5cdb requires Emacs 28.1, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 95e6f9186e 09/67: Update one-line description, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 69e8f87214 04/67: Add agitate-vc-git-push, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 5a1b31fe09 06/67: Add agitate-log-view-kill-revision command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 2250f3d039 33/67: Expand the README.org, ELPA Syncer, 2022/09/28