[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate f9dd3b3f91 41/67: Add agitate-vc-git-kill-commi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate f9dd3b3f91 41/67: Add agitate-vc-git-kill-commit-message command |
Date: |
Wed, 28 Sep 2022 16:57:28 -0400 (EDT) |
branch: externals/agitate
commit f9dd3b3f91ccd22754a6bdabcbe6f48195dfa007
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add agitate-vc-git-kill-commit-message command
---
README.org | 7 +++++++
agitate.el | 23 +++++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/README.org b/README.org
index e50ee05df1..10fea286d5 100644
--- a/README.org
+++ b/README.org
@@ -165,6 +165,13 @@ think most of those are superfluous. Less is more.
Git repository. Use the original ~vc-git-grep~ for its other
features.
+#+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.
+
#+findex: agitate-vc-git-push-prompt-for-remote
+ ~agitate-vc-git-push-prompt-for-remote~ :: Behave like ~vc-git-push~
but prompt for a remote, if needed. The meaning of =PROMPT= is the
diff --git a/agitate.el b/agitate.el
index 6d3e112aea..ac15422f9d 100644
--- a/agitate.el
+++ b/agitate.el
@@ -277,6 +277,29 @@ features."
(completing-read "Select Git remote: " remotes nil t)
(car remotes))))
+(defvar agitate--vc-git-kill-commit-message-history nil
+ "Minibuffer history of `agitate-vc-git-kill-commit-message'.")
+
+(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)))
+
+;;;###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.
+
+This is useful to quote a past commit message."
+ (interactive (list (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" "--"))
+ (buffer-substring-no-properties (point-min) (point-max)))))
+
;; TODO 2022-09-27: We can have something similar which prompts for a
;; branch to push to. There are lots of possibilities. The idea is
;; that the user can pick the function they are most likely to use as
- [elpa] externals/agitate 9146d7cd54 31/67: Rename to agitate-diff-enable-outline-minor-mode, (continued)
- [elpa] externals/agitate 9146d7cd54 31/67: Rename to agitate-diff-enable-outline-minor-mode, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 27cdb6fd95 57/67: Improve agitate-vc-git-prompt-format-patch-single, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 1df9714eb6 49/67: Accept optional long agitate--vc-git-commit-prompt, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate ed6c5cfb71 32/67: Capitalise Unicode in doc string, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate aa04a25eb1 58/67: Rename to agitate-vc-git-format-patch-single, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate a9a8339126 46/67: Add PROOF OF CONCEPT vc-git-find-revision, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 412834ce07 66/67: Fix file no dir in agitate--log-edit-extract-file, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate a32ed823b6 24/67: Add TODO about conventional commits, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate fa0a9e5260 42/67: Add echo to agitate-vc-git-kill-commit-message, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 063d94c983 35/67: Add generic README in markdown, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate f9dd3b3f91 41/67: Add agitate-vc-git-kill-commit-message command,
ELPA Syncer <=
- [elpa] externals/agitate ca4b65bf85 36/67: Add gitignore, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 0b80819820 62/67: Refine regexp for git hash extraction, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 45eb3b6c5d 54/67: Declare agitate-vc-git-show as interactive-only, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 912161bfc1 27/67: Add doclicense.texi which is used in the manual, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 6eb66ed1cc 44/67: Add helper to extract commit hash, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 8bb7652cac 43/67: Rename to agitate-vc-git-grep, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 496eba8497 52/67: Add agitate-vc-git-show prototype, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 1e998e1466 59/67: Rename helper for single commit command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate de2094a2f5 53/67: Placate the compiler, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 50251c7eff 64/67: Add agitate-log-view-kill-revision-expanded cmd, ELPA Syncer, 2022/09/28