emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/agitate 052d3e3570 61/67: Simplify agitate--vc-git-comm


From: ELPA Syncer
Subject: [elpa] externals/agitate 052d3e3570 61/67: Simplify agitate--vc-git-commit-prompt
Date: Wed, 28 Sep 2022 16:57:30 -0400 (EDT)

branch: externals/agitate
commit 052d3e357019be2f67e83291d73ab9bcc67f92ad
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@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.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]