Commit 63b55c1d authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-patch-popup: new popup

Please note that this is an early version.  Future versions will also
feature `git send-email' and `git imap-send' and more arguments.  But
implementing that requires much more work, mainly because it has to
be well integrated with external tools, and won't be done before the

If I think that some important argument is missing, then please add
it locally using `magit-define-popup-{switch,option}'.
parent f5a5cdc5
......@@ -171,7 +171,7 @@ the user has to confirm each save."
(define-key map "U" 'magit-reset-index)
(define-key map "V" 'magit-revert-popup)
(define-key map "w" 'magit-am-popup)
(define-key map "W" 'magit-format-patch)
(define-key map "W" 'magit-patch-popup)
(define-key map "x" 'magit-reset)
(define-key map "y" 'magit-show-refs-popup)
(define-key map "Y" 'magit-cherry)
......@@ -243,8 +243,28 @@ branch as default."
;;; Email
(magit-define-popup magit-patch-popup
"Popup console for patch commands."
:man-page "git-format-patch"
:options '((?f "From" "--from=")
(?t "To" "--to=")
(?c "CC" "--cc=")
(?r "In reply to" "--in-reply-to=")
(?v "Reroll count" "--reroll-count=")
(?s "Thread style" "--thread=")
(?U "Context lines" "-U")
(?M "Detect renames" "-M")
(?C "Detect copies" "-C")
(?A "Diff algorithm" "--diff-algorithm="
(?o "Output directory" "--output-directory="))
:actions '((?p "Format patches" magit-format-patch)
(?r "Request pull" magit-request-pull))
:default-action 'magit-format-patch)
(defun magit-format-patch (range)
(defun magit-format-patch (range args)
"Create patches for the commits in RANGE."
(list (-if-let (revs (magit-region-values 'commit))
......@@ -252,8 +272,9 @@ branch as default."
(let ((range (magit-read-range-or-commit "Format range or commit")))
(if (string-match-p "\\.\\." range)
(format "%s~..%s" range range))))))
(magit-run-git "format-patch" range))
(format "%s~..%s" range range))))
(magit-run-git "format-patch" range args))
(defun magit-request-pull (url start end)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment