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

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

[elpa] externals/agitate 69e8f87214 04/67: Add agitate-vc-git-push


From: ELPA Syncer
Subject: [elpa] externals/agitate 69e8f87214 04/67: Add agitate-vc-git-push
Date: Wed, 28 Sep 2022 16:57:25 -0400 (EDT)

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

    Add agitate-vc-git-push
---
 agitate.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/agitate.el b/agitate.el
index bb68c6cbf9..59c79d29cf 100644
--- a/agitate.el
+++ b/agitate.el
@@ -32,6 +32,7 @@
 ;;; Code:
 
 (require 'log-edit)
+(require 'vc-git)
 
 (defgroup agitate ()
   "Work-in-progress."
@@ -62,5 +63,19 @@ file extension.  Else omit it."
   (interactive "P" log-edit-mode)
   (insert (format "%s: " (agitate--log-edit-extract-file 
with-file-extension))))
 
+;;;; Commands for vc-git (Git backend for the Version Control framework)
+
+(defun agitate--vc-git-prompt-remote ()
+  "Helper prompt for `agitate-git-push'."
+  (when-let ((remotes (process-lines vc-git-program "remote")))
+    (if (length> remotes 1)
+        (completing-read "Select Git remote: " remotes nil t)
+      (car remotes))))
+
+;;;###autoload
+(defun agitate-vc-git-push (prompt)
+  "Substitute for `vc-git-push' with the same meaning for PROMPT."
+  (vc-git--pushpull "push" prompt (unless prompt 
`(,(agitate--vc-git-prompt-remote)))))
+
 (provide 'agitate)
 ;;; agitate.el ends here



reply via email to

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