[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate 7c88d4e621 4/4: Add simple agitate-vc-git-kill-
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate 7c88d4e621 4/4: Add simple agitate-vc-git-kill-commit-hash command |
Date: |
Tue, 4 Oct 2022 12:57:16 -0400 (EDT) |
branch: externals/agitate
commit 7c88d4e6214f8bc9fdbcfad2541333f7ef973fcb
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add simple agitate-vc-git-kill-commit-hash command
Maybe this is not useful and would be better provided as a prefix
argument for 'agitate-vc-git-kill-commit-message'. We shall see.
---
README.org | 11 ++++++++++-
agitate.el | 23 +++++++++++++++++++----
2 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/README.org b/README.org
index 283710abca..6f344523d2 100644
--- a/README.org
+++ b/README.org
@@ -219,6 +219,13 @@ non-nil, the root log of the revisions is shown.
Git repository. Use the original ~vc-git-grep~ for its other
arguments.
+#+findex: agitate-vc-git-kill-commit-hash
++ Function ~agitate-vc-git-kill-commit-hash~ :: Append to ~kill-ring~
+ hash of commit. Prompt for commit using minibuffer completion. The
+ number of revisions in the log is controlled by the user option
+ ~agitate-log-limit~. To kill the message of the commit, use the
+ command ~agitate-vc-git-kill-commit-message~.
+
#+findex: agitate-vc-git-kill-commit-message
+ Function ~agitate-vc-git-kill-commit-message~ :: Append to
~kill-ring~ message of commit with =HASH= identifier. When called
@@ -226,7 +233,9 @@ non-nil, the root log of the revisions is shown.
point is in a log-view buffer, make the revision at point the
default value of the prompt (though also see the command
~agitate-log-view-kill-revision-expanded~). The number of revisions
- in the log is controlled by the user option ~agitate-log-limit~.
+ in the log is controlled by the user option ~agitate-log-limit~. To
+ kill only the commit hash, use the command
+ ~agitate-vc-git-kill-commit-hash~.
#+findex: agitate-vc-git-push-prompt-for-remote
+ Function ~agitate-vc-git-push-prompt-for-remote~ :: Behave like
diff --git a/agitate.el b/agitate.el
index 081c7364c5..f1a192f8c5 100644
--- a/agitate.el
+++ b/agitate.el
@@ -553,9 +553,21 @@ arguments."
nil t nil
'agitate--vc-git-kill-commit-message-history default-value)))
-;; TODO 2022-10-03: Either add a command that copies just the hash
-;; from a completion prompt, or make this accept a prefix argument. I
-;; prefer a separate command.
+;;;###autoload
+(defun agitate-vc-git-kill-commit-hash ()
+ "Append to `kill-ring' hash of commit.
+Prompt for commit using minibuffer completion. The number of
+revisions in the log is controlled by the user option
+`agitate-log-limit'.
+
+To kill the message of the commit, use the command
+`agitate-vc-git-kill-commit-message'."
+ (declare (interactive-only t))
+ (interactive)
+ (let ((hash (agitate--vc-git-get-hash-from-string
+ (agitate--vc-git-kill-commit-message-prompt))))
+ (kill-new hash)
+ (message "Added `%s' to `kill-ring'" hash)))
;;;###autoload
(defun agitate-vc-git-kill-commit-message (hash)
@@ -568,7 +580,10 @@ the default value of the prompt (though also see the
command
`agitate-log-view-kill-revision-expanded').
The number of revisions in the log is controlled by the user
-option `agitate-log-limit'."
+option `agitate-log-limit'.
+
+To kill only the commit hash, use the command
+`agitate-vc-git-kill-commit-hash'."
(interactive
(list
(agitate--vc-git-get-hash-from-string