emacscollective / epkg

Browse the Emacsmirror package database
https://emacsmirror.net/manual/epkg
GNU General Public License v3.0
55 stars 7 forks source link

epkg-update command should be more verbose #4

Closed caadar closed 7 years ago

caadar commented 7 years ago

Consider to show some info about actions (including git output?) and result status in echo area.

tarsius commented 7 years ago

There actually already is some code that is supposed to make that happen, but it cannot possibly work as intended. But I think displaying the git output is a good idea and will try to implement this properly.

tarsius commented 7 years ago

I decided to do this:

  1. Display a simple Pulling Epkg database... message.
  2. To no longer pull submodules, which means that pulling now is fairly quick and so the message from (1) is sufficient.

It would be possible to display the git output using something like the following - but that is quite a hack.

diff --git a/epkg.el b/epkg.el
index 1310255..616a182 100644
--- a/epkg.el
+++ b/epkg.el
@@ -130,7 +130,14 @@ (declare-function magit-call-git "magit-process" (&rest args))

 (defun epkg--call-git (&rest args)
   (if (require 'magit nil t)
-      (magit-call-git args)
+      (progn
+        (magit-run-git-async args)
+        (condition-case nil
+            (while (and magit-this-process
+                        (eq (process-status magit-this-process) 'run))
+              (sleep-for 0.05)
+              (redisplay t))
+          (quit (kill-process magit-this-process))))
     (with-current-buffer (generate-new-buffer " *Epkg-Git*")
       (switch-to-buffer-other-window (current-buffer))
       (apply #'call-process "git" nil t t args))))