emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/agitate 26b614b130: Add agitate-vc-git-format-patch-n-f


From: ELPA Syncer
Subject: [elpa] externals/agitate 26b614b130: Add agitate-vc-git-format-patch-n-from-head cmd
Date: Thu, 29 Sep 2022 09:57:17 -0400 (EDT)

branch: externals/agitate
commit 26b614b130072c24a018fd07882be6e777c29bfa
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add agitate-vc-git-format-patch-n-from-head cmd
---
 README.org |  5 +++++
 agitate.el | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/README.org b/README.org
index 55749286f7..fea2f4d7a9 100644
--- a/README.org
+++ b/README.org
@@ -179,6 +179,11 @@ commits" are documented here: 
<https://www.conventionalcommits.org/en/v1.0.0/>.
   ;; ~/Desktop or some dedicated "patches" directory.
   #+end_src
 
+#+findex: agitate-vc-git-format-patch-n-from-head
++ ~agitate-vc-git-format-patch-n-from-head~ :: Format patches covering
+  =NUMBER= of commits from current HEAD.  This is the eqvuivalent of:
+  =git format-patch -NUMBER=.
+
 #+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 47c9bbefe9..23109c7941 100644
--- a/agitate.el
+++ b/agitate.el
@@ -378,6 +378,16 @@ The number of completion candidates is limited to the 
value of
     (apply 'vc-git-command nil nil nil
            (list "format-patch" "-1" commit "--"))))
 
+;;;###autoload
+(defun agitate-vc-git-format-patch-n-from-head (number)
+  "Format patches covering NUMBER of commits from current HEAD.
+This is the eqvuivalent of: git format-patch -NUMBER."
+  (interactive (list (read-number "git format-patch -NUMBER: ")))
+  (if (natnump number)
+      (apply 'vc-git-command nil 0 nil
+             (list "format-patch" (format "-%d" number)))
+    (user-error "NUMBER must satisfy `natnump'; `%s' does not" number)))
+
 ;;;###autoload
 (defun agitate-vc-git-grep (regexp)
   "Run `git-grep(1)' for REGEXP in `vc-root-dir'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]