From: Xinglu Chen <public@yoctocell.xyz>
To: 50426@debbugs.gnu.org
Subject: [bug#50426] [PATCH] import: elpa: Don't hardcode default branch to 'master'.
Date: Mon, 06 Sep 2021 12:57:04 +0200 [thread overview]
Message-ID: <7a5a35f29121ebbb2e1ec1fe991159fbf6bae2e4.1630925679.git.public@yoctocell.xyz> (raw)
Otherwise, remotes without a branch named 'master' will cause an error when
importing.
* guix/import/elpa (git-repository->origin): Fallback to HEAD instead of the
'master' branch.
---
For example, try to import the ‘consult’ package from MELPA:
--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix import elpa -a melpa consult
;;; note: source file /home/yoctocell/src/guix/guix/import/elpa.scm
;;; newer than compiled /home/yoctocell/src/guix/guix/import/elpa.go
;;; note: source file /home/yoctocell/src/guix/guix/import/elpa.scm
;;; newer than compiled /home/yoctocell/.config/guix/current/lib/guile/3.0/site-ccache/guix/import/elpa.go
;;; note: source file /home/yoctocell/src/guix/guix/import/elpa.scm
;;; newer than compiled /home/yoctocell/.guix-home/profile/lib/guile/3.0/site-ccache/guix/import/elpa.go
Backtrace:
In ice-9/boot-9.scm:
1752:10 16 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In unknown file:
15 (apply-smob/0 #<thunk 7f9dcef69f60>)
In ice-9/boot-9.scm:
724:2 14 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
619:8 13 (_ #(#(#<directory (guile-user) 7f9dcef63c80>)))
In guix/ui.scm:
2185:7 12 (run-guix . _)
2148:10 11 (run-guix-command _ . _)
In guix/scripts/import.scm:
121:11 10 (guix-import . _)
In guix/scripts/import/elpa.scm:
104:23 9 (guix-import-elpa . _)
In guix/import/elpa.scm:
207:2 8 (elpa->guix-package _ #:repo _ #:version _)
In ice-9/boot-9.scm:
1752:10 7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/store.scm:
658:37 6 (thunk)
In guix/git.scm:
481:8 5 (latest-repository-commit #<store-connection 256.99 7f9dc996c820> "https://github.com/…" …)
247:4 4 (update-cached-checkout _ #:ref _ #:recursive? _ #:check-out? _ #:starting-commit _ # _ …)
211:19 3 (resolve _)
In git/branch.scm:
101:8 2 (_ _ _ _)
In git/bindings.scm:
77:2 1 (raise-git-error _)
In ice-9/boot-9.scm:
1685:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Git error: cannot locate remote-tracking branch 'origin/master'
--8<---------------cut here---------------end--------------->8---
guix/import/elpa.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index c0dc5acf51..f9689aaa13 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -257,7 +258,7 @@ RECIPE."
((assoc-ref recipe #:commit)
=> (lambda (commit) (cons 'commit commit)))
(else
- '(branch . "master"))))
+ '())))
(let-values (((directory commit) (download-git-repository url ref)))
`(origin
base-commit: 9540323458de87b0b8aa421e449a4fe27af7c393
--
2.33.0
next reply other threads:[~2021-09-06 10:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-06 10:57 Xinglu Chen [this message]
2021-09-10 15:27 ` bug#50426: [PATCH] import: elpa: Don't hardcode default branch to 'master' Ludovic Courtès
2021-09-10 17:56 ` [bug#50426] " Xinglu Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7a5a35f29121ebbb2e1ec1fe991159fbf6bae2e4.1630925679.git.public@yoctocell.xyz \
--to=public@yoctocell.xyz \
--cc=50426@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).