diff options
author | Gustav Hållberg <gustav@gmail.com> | 2010-04-29 17:20:48 +0200 |
---|---|---|
committer | Gustav Hållberg <gustav@gmail.com> | 2010-04-30 00:28:34 +0200 |
commit | 15d774abedd480f35830f16c4872afd359664103 (patch) | |
tree | d1e88bae836281b0e58545b4828033bc570d902a | |
parent | 8f489f41f8ffe6e06254cefc5b352610df06cbeb (diff) | |
download | stgit-15d774abedd480f35830f16c4872afd359664103.tar.gz |
stgit.el: Make ! with prefix argument prompt for git command
Signed-off-by: Gustav Hållberg <gustav@gmail.com>
-rw-r--r-- | contrib/stgit.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/stgit.el b/contrib/stgit.el index 24d4759..1bc78a2 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -2451,25 +2451,29 @@ deepest patch had before the squash." (unless at-pmark (goto-char old-point))))) -(defun stgit-execute () +(defun stgit-execute (&optional git-mode) "Prompt for an stg command to execute in a shell. The names of any marked patches or the patch at point are inserted in the command to be executed. +With a prefix argument, or if GIT-MODE is non-nil, insert SHA1 +sums of the marked patches instead, and prompt for a git command. + If the command ends in an ampersand, run it asynchronously. When the command has finished, reload the stgit buffer." - (interactive) + (interactive "P") (stgit-assert-mode) (let* ((patches (stgit-sort-patches (stgit-patches-marked-or-at-point nil 'allow-committed))) (patch-names (mapcar 'symbol-name patches)) (hyphens (find-if (lambda (s) (string-match "^-" s)) patch-names)) (defaultcmd (if patches - (concat "stg " + (concat (if git-mode "git" "stg") " " (and hyphens "-- ") - (mapconcat 'identity patch-names " ")) + (mapconcat (if git-mode 'stgit-id 'identity) + patch-names " ")) "stg ")) (cmd (read-from-minibuffer "Shell command: " (cons defaultcmd 5) nil nil 'shell-command-history)) |