aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git-email.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/git-email.el b/git-email.el
index 9bbad13..d1334a1 100644
--- a/git-email.el
+++ b/git-email.el
@@ -104,6 +104,11 @@ not set, the 'to' address will be empty."
:type 'string
:group 'git-email)
+(defcustom git-email-revision-parser #'git-email--parse-revision
+ "Function for parsing the output of ‘git-email-revision-command’."
+ :type 'symbol
+ :group git-email)
+
(defcustom git-email-get-revision-functions '(git-email--log-get-revision)
"List of functions to get the base commit for 'git format-patch'.
If none of the functions return non-nil value,
@@ -283,7 +288,13 @@ them into the message buffer."
(cycle-sort-function . identity))
(complete-with-action
action revs string pred)))))
- (substring (completing-read "Revision: " sorted-revs) 0 7)))
+ (git-email--parse-revision (completing-read "Revision: " sorted-revs))))
+
+(defun git-email--parse-revision (rev)
+ "Return only the revision hash from REV
+
+This parses the output of ‘git-email--minibuffer-get-revision’."
+ (substring rev 0 7))
(defun git-email--log-get-revision ()
"Get the revision at point in `log-view-mode'."