branch: externals/agitate commit 052d3e357019be2f67e83291d73ab9bcc67f92ad Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Simplify agitate--vc-git-commit-prompt --- agitate.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/agitate.el b/agitate.el index e5c3ba3d23..88a22fe814 100644 --- a/agitate.el +++ b/agitate.el @@ -241,17 +241,15 @@ to the text at point." "Prompt for Git commit and return it as a string. With optional FILE, limit the commits to those pertinent to it. With optional LONG do not abbreviate commit hashes." - (let ((default-directory (vc-root-dir)) - (format (if long "--pretty=oneline" "--oneline"))) - (if file - (completing-read - (format "Select revision of `%s': " file) - (process-lines vc-git-program "log" format file) - nil t) - (completing-read - "Select revision: " - (process-lines vc-git-program "log" format "--") - nil t)))) + (let* ((prompt (if file + (format "Select revision of `%s': " file) + "Select revision: ")) + (commit-format (if long "--pretty=oneline" "--oneline")) + (default-directory (vc-root-dir))) + (completing-read + prompt + (process-lines vc-git-program "log" commit-format (or file "--")) + nil t))) (defvar agitate-vc-git-show-buffer "*agitate-vc-git-show*" "Buffer for showing a git commit.")