[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin d56a357 416/439: * elpa-admin.el: Don't hide the log
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin d56a357 416/439: * elpa-admin.el: Don't hide the log of diverged packages in `fetch/<pkg>` |
Date: |
Sun, 17 Oct 2021 15:48:48 -0400 (EDT) |
branch: elpa-admin
commit d56a357f84f4473acffd89fe9635270d52eb8542
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* elpa-admin.el: Don't hide the log of diverged packages in `fetch/<pkg>`
(elpaa--copyright-files): Also ignore `tests`.
(elpaa--fetch): Add `show-diverged`. Show both sides of a diversion.
(elpaa--batch-fetch-and): Make it non-nil when there's a single package.
---
elpa-admin.el | 34 +++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/elpa-admin.el b/elpa-admin.el
index 1f3d7b7..48fc5de 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1461,7 +1461,7 @@ If WITH-CORE is non-nil, it means we manage :core
packages as well."
(let* ((pkgname (car pkg-spec))
(default-directory (elpaa--dirname pkgname "packages"))
(ignores (elpaa--spec-get pkg-spec :ignored-files))
- (all-ignores '("." ".." ".git" "test" ".dir-locals.el"))
+ (all-ignores '("." ".." ".git" "test" "tests" ".dir-locals.el"))
(dir-files (lambda (d)
(cl-set-difference (directory-files d)
all-ignores :test #'equal)))
@@ -1688,7 +1688,7 @@ More at " (elpaa--default-url pkgname))
"Return non-nil iff BRANCH is an existing branch."
(equal 0 (elpaa--call t "git" "show-ref" "--verify" "--quiet" branch)))
-(defun elpaa--fetch (pkg-spec &optional k)
+(defun elpaa--fetch (pkg-spec &optional k show-diverged)
(let* ((pkg (car pkg-spec))
(url (or (elpaa--spec-get pkg-spec :external)
(elpaa--spec-get pkg-spec :url)))
@@ -1714,12 +1714,26 @@ More at " (elpaa--default-url pkgname))
(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))
+ (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))
- (message "Upstream of %s has diverged" pkg))
- ((let* ((ortb (elpaa--ortb pkg-spec))
- (exists (elpaa--git-branch-p ortb)))
+ (message "Upstream of %s has DIVERGED!\n" pkg)
+ (when show-diverged
+ (elpaa--call t "git" "log"
+ "--format=%h %<(16,trunc)%ae %s"
+ (format "%s..%s" urtb ortb))
+ (message " Local changes:\n%s" (buffer-string))
+ (erase-buffer)
+ (elpaa--call t "git" "log"
+ "--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
@@ -1763,11 +1777,13 @@ More at " (elpaa--default-url pkgname))
(message "Push error for %s:\n%s" pkg (buffer-string)))))))
(defun elpaa--batch-fetch-and (k)
- (let ((specs (elpaa--get-specs))
- (pkgs command-line-args-left)
- (condition ':))
+ (let* ((specs (elpaa--get-specs))
+ (pkgs command-line-args-left)
+ (show-diverged (not (cdr pkgs)))
+ (condition ':))
(setq command-line-args-left nil)
(when (and (null (cdr pkgs)) (string-match "\\`:" (car pkgs)))
+ (setq show-diverged nil)
(setq condition (intern (car pkgs)))
(setq pkgs (mapcar #'car specs)))
(dolist (pkg pkgs)
@@ -1778,7 +1794,7 @@ More at " (elpaa--default-url pkgname))
(elpaa--spec-get pkg-spec condition))
;; (unless (file-directory-p (expand-file-name pkg "packages"))
;; (elpaa--worktree-sync pkg-spec))
- (elpaa--fetch pkg-spec k)))))))
+ (elpaa--fetch pkg-spec k show-diverged)))))))
(defun elpaa-batch-fetch-and-show (&rest _)
(elpaa--batch-fetch-and #'ignore))
- [nongnu] elpa-admin 7d65683 356/439: * admin/archive-contents.el: Fix wrong cgit links and support :core somewhat, (continued)
- [nongnu] elpa-admin 7d65683 356/439: * admin/archive-contents.el: Fix wrong cgit links and support :core somewhat, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4ade74d 346/439: * README.org: Add license and an introduction., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 922d625 389/439: * GNUmakefile (EMACS): Split out EMACSBIN for convenience, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin bcacdba 361/439: * elpa-admin.el: Add `:readme` and `:news` properties to specifications, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 311d819 357/439: * GNUmakefile: Fix `-l` args to `emacs` which require an actual file name, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 802b866 394/439: * GNUmakefile (sync-some): New target, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b3e663b 353/439: Rename ELisp files, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4b508ad 364/439: * elpa-admin.el: Allow site-local config, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 48e4ccf 388/439: * elpa-admin.el: Don't pass non-existing dirs to `bwrap`, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 12cd68f 386/439: * README.org: Update according to comments from RMS., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d56a357 416/439: * elpa-admin.el: Don't hide the log of diverged packages in `fetch/<pkg>`,
Philip Kaludercic <=
- [nongnu] elpa-admin e79cce6 382/439: * elpa-admin.el (elpaa--get-section): Fix fetching from main file, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 2b93ca3 363/439: * elpa-admin.el: Add support for building Texi from Org., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b776ff9 408/439: * elpa-admin.el (elpaa--prune-old-tarballs): Move the .sig files as well, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 911fbf6 370/439: * GNUmakefile: Try and unbreak "make packages/foo". Still not perfect, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin bdb17b6 409/439: * elpa-admin.el (elpaa--get-devel-version): Don't remove *all* zeroes!, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 0fe87ad 380/439: * elpa-admin.el (elpaa--release-email): Usual last minute typo, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 1ee6e0e 383/439: * elpa-admin.el (elpaa--get-section): Use the whole section, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 68c0d47 414/439: * elpa-admin.el (elpaa--fetch): Don't show the log if branches diverged, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 54ca8ea 415/439: * elpa-admin.el: Don't build release tarballs for pre-release versions, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin fd42057 422/439: Prefer HTTPS to HTTP, Philip Kaludercic, 2021/10/17