diff options
author | yoctocell <public@yoctocell.xyz> | 2021-01-07 09:10:22 +0100 |
---|---|---|
committer | yoctocell <public@yoctocell.xyz> | 2021-01-07 09:10:22 +0100 |
commit | 12fa36b6b635bc428d88fde4d3bbc930b0f7bfcc (patch) | |
tree | 270d250377ea7ad0d77a63eaa697a0042a75a2fa /git-email.el | |
parent | b7b4cd4bd8b9ebef4d0244c73c02ebdbe3b3c71d (diff) |
Dont' colorize revision
Let the user specify the 'git log' command to run, this wont really play
well with the current colorization regex.
* git-email.el (git-email-revision-command):
(git-email--get-revision):
Diffstat (limited to 'git-email.el')
-rw-r--r-- | git-email.el | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/git-email.el b/git-email.el index e3a08e1..ad75a8d 100644 --- a/git-email.el +++ b/git-email.el @@ -119,6 +119,12 @@ variable." :type 'int :group 'git-email) +(defcustom git-email-revision-command + "git log --no-color --pretty='format:%h %d %d' --abbrev-commit -n " + "Command to run to get a list of revisions." + :type 'string + :group 'git-email) + (defface git-email-revision-face '((t :inherit font-lock-comment-face)) "Face used for the revision when selecting from the minibuffer.") @@ -254,24 +260,9 @@ them into the message buffer." (revs (butlast (split-string (shell-command-to-string (concat - "git log --no-color --date=short " - "--pretty='format:%h %d %s'" - " --abbrev-commit -n " + git-email-revision-command (int-to-string git-email-revision-limit))) "\n"))) - ;; Colorize - (colored-revs - (mapcar (lambda (rev) - (concat - (propertize - (replace-regexp-in-string "\\([a-f0-9]+\\) .*$" - "\\1" rev) - 'face 'git-email-revision-face) - (propertize - (replace-regexp-in-string "[a-f0-9]+ \\(.*$\\)" - "\\1" rev) - 'face 'default))) - revs)) ;; Sort the candidates correctly. ;; See https://emacs.stackexchange.com/a/41808. (sorted-revs @@ -280,7 +271,7 @@ them into the message buffer." '(metadata (display-sort-function . identity) (cycle-sort-function . identity)) (complete-with-action - action colored-revs string pred))))) + action revs string pred))))) (substring (completing-read "Revision: " sorted-revs) 0 7))) ;;;###autoload @@ -313,7 +304,6 @@ arguments in `git-email-format-patch-default-args' will be used." (git-email--compose-email file) (run-hooks 'git-email-post-compose-email-hook)))) - ;;;; Operate on emails (defun git-email-send-all () "Send all unsent emails." |