[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate 27cdb6fd95 57/67: Improve agitate-vc-git-prompt
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate 27cdb6fd95 57/67: Improve agitate-vc-git-prompt-format-patch-single |
Date: |
Wed, 28 Sep 2022 16:57:29 -0400 (EDT) |
branch: externals/agitate
commit 27cdb6fd95ad88a10308214148dd805de6a64a76
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Improve agitate-vc-git-prompt-format-patch-single
---
README.org | 5 ++++-
agitate.el | 16 ++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/README.org b/README.org
index 16d3aa2e91..2daa6ebf16 100644
--- a/README.org
+++ b/README.org
@@ -155,7 +155,10 @@ think most of those are superfluous. Less is more.
#+findex: agitate-vc-git-prompt-format-patch-single
+ ~agitate-vc-git-prompt-format-patch-single~ :: Format patch for a
- single =COMMIT=. Prompt for =COMMIT= using minibuffer completion.
+ single =COMMIT=. If in a log-view buffer, the =COMMIT= is the one
+ at point. For the details of how that is determined, read the doc
+ string of ~agitate-log-view-kill-revision~. If there is no such
+ commit at point, prompt for =COMMIT= using minibuffer completion.
Output the patch file to the return value of the function
~vc-root-dir~. Relevant except from the source code:
diff --git a/agitate.el b/agitate.el
index ca34d3170c..cddd7eb662 100644
--- a/agitate.el
+++ b/agitate.el
@@ -277,15 +277,27 @@ to those pertaining to the current file."
(with-current-buffer (pop-to-buffer buf)
(diff-mode))))
+(defun agitate--vc-git-format-patch-single-behaviour ()
+ "Help `agitate-vc-git-prompt-format-patch-single' with its COMMIT."
+ (if-let ((default-value (cadr (log-view-current-entry (point) t))))
+ default-value
+ (agitate--vc-git-get-hash-from-string (agitate--vc-git-commit-prompt))))
+
;;;###autoload
(defun agitate-vc-git-prompt-format-patch-single (commit)
"Format patch for a single COMMIT.
-Prompt for COMMIT using minibuffer completion.
+
+If in a log-view buffer, the COMMIT is the one at point. For the
+details of how that is determined, read the doc string of
+`agitate-log-view-kill-revision'.
+
+If there is no such commit at point, prompt for COMMIT using
+minibuffer completion.
Output the patch file to the return value of the function
`vc-root-dir'."
(interactive
- (list (agitate--vc-git-get-hash-from-string
(agitate--vc-git-commit-prompt))))
+ (list (agitate--vc-git-format-patch-single-behaviour)))
;; TODO 2022-09-27: Handle the output directory better. Though I am
;; not sure how people work with those. I normally use the root of
;; the current repo (and then clean it) or put everything in the
- [elpa] externals/agitate 764644c218 15/67: Use 'length>' again since b6e5cdb requires Emacs 28.1, (continued)
- [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
- [elpa] externals/agitate 2c9f6bb3be 20/67: Rename to agitate-vc-git-push-prompt-for-remote, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 418d24bd13 60/67: Tweak comments about gitmoji, conventional commits, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate d808406253 48/67: Edit vc-git-show (PROOF OF CONCEPT), ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 4192d8d892 51/67: Clarify doc of helper function, ELPA Syncer, 2022/09/28
- [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 <=
- [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, 2022/09/28
- [elpa] externals/agitate ca4b65bf85 36/67: Add gitignore, ELPA Syncer, 2022/09/28