From 46c89d350e9b1ad8129e1699c264b4ed58dcfd82 Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Fri, 4 Jun 2021 15:02:00 +0300 Subject: [PATCH 1/2] cli/packages: fix commit between pins counting the commit counting introduced in a3df5bf prints `nil` instead of the empty string when the repo moves from commit A to commit B where A isn't reachable from B --- core/cli/packages.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/cli/packages.el b/core/cli/packages.el index f922eaad8..f9cfc4748 100644 --- a/core/cli/packages.el +++ b/core/cli/packages.el @@ -447,7 +447,8 @@ declaration) or dependency thereof that hasn't already been." (doom--abbrev-commit ref) (doom--abbrev-commit target-ref) (if (and (integerp commits) (> commits 0)) - (format " [%d commit(s)]" commits))) + (format " [%d commit(s)]" commits) + "")) (unless (string-empty-p output) (let ((lines (split-string output "\n"))) (setq output From f9a1d809367a1cfbe76257df0888e61d9196acb0 Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Fri, 4 Jun 2021 15:20:42 +0300 Subject: [PATCH 2/2] cli/packages: fix update output on unpinned packages - don't print output of git command - count commits and output log --- core/cli/packages.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/cli/packages.el b/core/cli/packages.el index f9cfc4748..73c23f6b0 100644 --- a/core/cli/packages.el +++ b/core/cli/packages.el @@ -402,9 +402,10 @@ declaration) or dependency thereof that hasn't already been." (print! (start "\033[K(%d/%d) Fetching %s...%s") i total package esc) (doom--straight-with (straight-vc-fetch-from-remote recipe) (when .it - (setq output .output) (straight-merge-package package) (setq target-ref (straight-vc-get-commit type local-repo)) + (setq output (doom--commit-log-between ref target-ref) + commits (length (split-string output "\n" t))) (or (not (doom--same-commit-p target-ref ref)) (cl-return)))))