[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin a5cffdb 374/439: * elpa-admin.el (elpaa--pull): Set
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin a5cffdb 374/439: * elpa-admin.el (elpaa--pull): Set the upstream branch if needed |
Date: |
Sun, 17 Oct 2021 15:48:39 -0400 (EDT) |
branch: elpa-admin
commit a5cffdb4f9e802f50714cc7e847e74c3b000edad
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* elpa-admin.el (elpaa--pull): Set the upstream branch if needed
---
elpa-admin.el | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/elpa-admin.el b/elpa-admin.el
index a88273c..bb69b16 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -988,16 +988,25 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
((file-directory-p ".git")
(message "Running git pull in %S" default-directory)
(elpaa--call t "git" "pull"))
- ((file-exists-p ".git")
- (if (with-temp-buffer
- (let ((elpaa--debug nil))
- (elpaa--call t "git" "status" "--branch" "--porcelain=2"))
- (goto-char (point-min))
- ;; Nothing to pull (nor push, actually).
- (search-forward "\n# branch.ab +0 -0" nil t))
- (elpaa--message "%s up-to-date" dirname)
- (message "Updating worktree in %S" default-directory)
- (elpaa--call t "git" "merge")))
+ ((file-exists-p ".git") ;A worktree, presumably.
+ (let ((status
+ (with-temp-buffer
+ (let ((elpaa--debug nil))
+ (elpaa--call t "git" "status" "--branch" "--porcelain=2"))
+ (buffer-string))))
+ (if (string-match "\n# branch.ab +0 -0" status)
+ (elpaa--message "%s up-to-date" dirname)
+ (unless (or (string-match "\n# branch.upstream" status)
+ (not (string-match
+ (concat "\n# branch.head \\("
+ (regexp-quote elpaa--branch-prefix)
+ ".*\\)")
+ status)))
+ ;; No upstream set yet.
+ (elpaa--call t "git" "branch" "--set-upstream-to"
+ (concat "origin/" (match-string 1 status))))
+ (message "Updating worktree in %S" default-directory)
+ (elpaa--call t "git" "merge"))))
(t (error "No .git in %S" default-directory)))
(unless (and (eobp) (bobp))
(message "Updated %s:%s%s" dirname
- [nongnu] elpa-admin c90458f 329/439: Add lang attributes to the html tag, (continued)
- [nongnu] elpa-admin c90458f 329/439: Add lang attributes to the html tag, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 2ce3401 333/439: * README: Don't recommend to keep code on `master` any more, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d30f5d1 337/439: * GNUmakefile (RULE-singlepkg): New rule(s) to compile single-pkg (bug#38140), Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin e48de90 332/439: * README: Fix typos., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin f6670e0 334/439: * .gitignore: Ignore all the unregistered files under `packages`, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d5c6272 339/439: * admin/archive-contents.el: foo.tar.sig is not an old tarball, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin de02176 397/439: * elpa-admin.el: Use :lisp-dir in default value of :main-file and :renames, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d5001e6 404/439: * elpa-admin.el: Keep the number of old tarballs under check, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 9126fc7 365/439: * elpa-admin.el: Fix date computation for :core packages, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 39eb0cf 343/439: * admin/archive-contents.el (batch-generate-description-file): New function, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin a5cffdb 374/439: * elpa-admin.el (elpaa--pull): Set the upstream branch if needed,
Philip Kaludercic <=
- [nongnu] elpa-admin d47f83f 373/439: * elpa-admin.el (elpaa--fetch): Use the default branch rather than "master", Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b1bcdc4 367/439: * elpa-admin.el (elpaa--pull): Be slightly less chatty, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 7e57ea1 371/439: * elpa-admin.el (elpaa--push): Don't checkout branch, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 1b69bf6 340/439: * admin/archive-contents.el: Don't use "git log" when not needed, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 14d46c2 375/439: * elpa-admin.el (elpaa--pull): Fix up oversight in last change, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 47280ce 402/439: * elpa-admin.el: Don't mention skipping :core if there are no :core, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 059dde5 344/439: * GNUmakefile (RULE-singlepkg): Add rules to install&compile each package, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin e22c225 395/439: * elpa-admin.el (elpaa--fetch): Only show upstream commits, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 2658af9 345/439: * admin/archive-contents.el: Add preliminary code to fetch upstream updates, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 0b84023 372/439: * elpa-admin.el: Fix confusing uses of word "external", Philip Kaludercic, 2021/10/17