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

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

[elpa] scratch/elpa-admin_fixes 76c74a1 1/4: * elpa-admin.el (elpaa--fet


From: Jonas Bernoulli
Subject: [elpa] scratch/elpa-admin_fixes 76c74a1 1/4: * elpa-admin.el (elpaa--fetch): Show no log before push to origin
Date: Thu, 21 Oct 2021 16:06:26 -0400 (EDT)

branch: scratch/elpa-admin_fixes
commit 76c74a11effee3435b43210b673c36eaf0572068
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    * elpa-admin.el (elpaa--fetch): Show no log before push to origin
    
    When a contributor runs "make fetch/<pkgname>" right after adding the
    new package to "elpa-packages", then "origin/<prefix>/<pkgname>" does
    not exist yet.
    
    Previously we ran "git log" three times in this situation.  The first
    two resulted in an error about the missing "origin/<prefix>/<pkgname>"
    and the third listed all commits of the package; potentially thousands.
---
 elpa-admin.el | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/elpa-admin.el b/elpa-admin.el
index 381aed6..98ebe23 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -2133,15 +2133,13 @@ relative to elpa root."
                                (if release-refspec
                                    (list release-refspec)))))
           (message "Fetch error for %s:\n%s" pkg (buffer-string)))
-         ((and
-           (zerop (elpaa--call t "git" "merge-base" "--is-ancestor"
-                               urtb ortb))
-           (elpaa--git-branch-p ortb))
+        ((not (elpaa--git-branch-p ortb))
+         (message "New package %s hasn't been pushed to origin yet" pkg))
+         ((zerop (elpaa--call t "git" "merge-base" "--is-ancestor"
+                              urtb ortb))
           (message "Nothing new upstream for %s" pkg))
-         ((and
-           (not (zerop (elpaa--call t "git" "merge-base" "--is-ancestor"
-                                    ortb urtb)))
-           (elpaa--git-branch-p ortb))
+         ((not (zerop (elpaa--call t "git" "merge-base" "--is-ancestor"
+                                   ortb urtb)))
           (message "Upstream of %s has DIVERGED!\n" pkg)
           (when show-diverged
             (elpaa--call t "git" "log"
@@ -2153,12 +2151,9 @@ relative to elpa root."
                          "--format=%h  %<(16,trunc)%ae  %s"
                          (format "%s..%s" ortb urtb))
             (message "  Upstream changes:\n%s" (buffer-string))))
-         ((let* ((exists (elpaa--git-branch-p ortb)))
-            (not (equal 0 (elpaa--call t "git" "log"
-                                       "--format=%h  %<(16,trunc)%ae  %s"
-                                       (if exists
-                                           (format "%s..%s" ortb urtb)
-                                         urtb)))))
+         ((not (zerop (elpaa--call t "git" "log"
+                                   "--format=%h  %<(16,trunc)%ae  %s"
+                                   (format "%s..%s" ortb urtb))))
           (message "Log error for %s:\n%s" pkg (buffer-string)))
          ((eq (point-min) (point-max))
           (message "No pending upstream changes for %s" pkg))



reply via email to

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