Fix #4036: improve 'doom sync -u' output
This commit is contained in:
parent
729e8d8f39
commit
c84127069f
1 changed files with 12 additions and 8 deletions
|
@ -61,10 +61,15 @@ list remains lean."
|
||||||
(if full commit (substring commit 0 7)))
|
(if full commit (substring commit 0 7)))
|
||||||
|
|
||||||
(defun doom--commit-log-between (start-ref end-ref)
|
(defun doom--commit-log-between (start-ref end-ref)
|
||||||
(and (straight--call
|
(when-let*
|
||||||
"git" "log" "--oneline" "--no-merges"
|
((status (straight--call
|
||||||
"-n" "25" end-ref (concat "^" (regexp-quote start-ref)))
|
"git" "log" "--oneline" "--no-merges"
|
||||||
(straight--process-get-output)))
|
"-n" "26" end-ref (concat "^" (regexp-quote start-ref))))
|
||||||
|
(output (string-trim-right (straight--process-get-output)))
|
||||||
|
(lines (split-string output "\n")))
|
||||||
|
(if (> (length lines) 25)
|
||||||
|
(concat (string-join (butlast lines 1) "\n") "\n[...]")
|
||||||
|
output)))
|
||||||
|
|
||||||
(defun doom--barf-if-incomplete-packages ()
|
(defun doom--barf-if-incomplete-packages ()
|
||||||
(let ((straight-safe-mode t))
|
(let ((straight-safe-mode t))
|
||||||
|
@ -359,13 +364,12 @@ declaration) or dependency thereof that hasn't already been."
|
||||||
(cl-return)))
|
(cl-return)))
|
||||||
(puthash local-repo t repos-to-rebuild)
|
(puthash local-repo t repos-to-rebuild)
|
||||||
(puthash package t packages-to-rebuild)
|
(puthash package t packages-to-rebuild)
|
||||||
(unless (string-empty-p output)
|
|
||||||
(print! (start "\033[K(%d/%d) Updating %s...") i total local-repo)
|
|
||||||
(print-group! (print! "%s" (indent 2 output))))
|
|
||||||
(print! (success "\033[K(%d/%d) %s updated (%s -> %s)")
|
(print! (success "\033[K(%d/%d) %s updated (%s -> %s)")
|
||||||
i total local-repo
|
i total local-repo
|
||||||
(doom--abbrev-commit ref)
|
(doom--abbrev-commit ref)
|
||||||
(doom--abbrev-commit target-ref)))
|
(doom--abbrev-commit target-ref))
|
||||||
|
(unless (string-empty-p output)
|
||||||
|
(print-group! (print! "%s" (indent 2 output)))))
|
||||||
(user-error
|
(user-error
|
||||||
(signal 'user-error (error-message-string e)))
|
(signal 'user-error (error-message-string e)))
|
||||||
(error
|
(error
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue