[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate c54fe94ac1 55/67: Add agitate-vc-git-prompt-for
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate c54fe94ac1 55/67: Add agitate-vc-git-prompt-format-patch-single cmd |
Date: |
Wed, 28 Sep 2022 16:57:29 -0400 (EDT) |
branch: externals/agitate
commit c54fe94ac19262c58fae1260c07b8f880785c03f
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add agitate-vc-git-prompt-format-patch-single cmd
---
README.org | 13 +++++++++++++
agitate.el | 18 ++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/README.org b/README.org
index 17d9b61f30..26cf0e3eef 100644
--- a/README.org
+++ b/README.org
@@ -153,6 +153,19 @@ think most of those are superfluous. Less is more.
=git-show(1)= on it. With optional =CURRENT-FILE= as prefix
argument, limit the commits to those pertaining to the current file.
+#+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.
+ Output the patch file to the return value of the function
+ ~vc-root-dir~. Relevant except from the source code:
+
+ #+begin_src emacs-lisp
+ ;; 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
+ ;; ~/Desktop or some dedicated "patches" directory.
+ #+end_src
+
#+findex: agitate-vc-git-grep
+ ~agitate-vc-git-grep~ :: Run ~git-grep(1)~ for =REGEXP= in
~vc-root-dir~. This is a simple wrapper around ~vc-git-grep~ to
diff --git a/agitate.el b/agitate.el
index d73dda4cfb..ca34d3170c 100644
--- a/agitate.el
+++ b/agitate.el
@@ -277,6 +277,24 @@ to those pertaining to the current file."
(with-current-buffer (pop-to-buffer buf)
(diff-mode))))
+;;;###autoload
+(defun agitate-vc-git-prompt-format-patch-single (commit)
+ "Format patch for a single COMMIT.
+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))))
+ ;; 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
+ ;; ~/Desktop or some dedicated "patches" directory.
+ (when-let* ((root (vc-root-dir))
+ (default-directory root))
+ (apply 'vc-git-command nil nil nil
+ (list "format-patch" "-1" commit "--"))))
+
;;;###autoload
(defun agitate-vc-git-grep (regexp)
"Run `git-grep(1)' for REGEXP in `vc-root-dir'.
- [elpa] externals/agitate e7b6acb8f7 12/67: Limit agitate-diff-refine-cycle to diff-mode, (continued)
- [elpa] externals/agitate e7b6acb8f7 12/67: Limit agitate-diff-refine-cycle to diff-mode, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 43027aefb9 16/67: Add agitate-diff-narrow-dwim command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 4baa368ffd 02/67: Depend on Emacs 29, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 417539dc73 03/67: Add agitate-log-edit-insert-file-name command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 1f35cecc20 17/67: Add agitate-diff-kill-dwim prototype, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 839892328b 28/67: Add missing backronym, ELPA Syncer, 2022/09/28
- [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 <=
- [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, 2022/09/28
- [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