From: "Ludovic Courtès" <ludo@gnu.org>
To: Kyle Meyer <kyle@kyleam.com>
Cc: 45187@debbugs.gnu.org
Subject: bug#45187: git download defaults to origin/master
Date: Mon, 14 Dec 2020 11:28:56 +0100 [thread overview]
Message-ID: <87zh2gu1ef.fsf@gnu.org> (raw)
In-Reply-To: <87v9d8dk0r.fsf@kyleam.com> (Kyle Meyer's message of "Fri, 11 Dec 2020 23:02:02 GMT")
Hi,
Kyle Meyer <kyle@kyleam.com> skribis:
> diff --git a/guix/git.scm b/guix/git.scm
> index ca77b9f54b..7320c0d6c8 100644
> --- a/guix/git.scm
> +++ b/guix/git.scm
> @@ -207,6 +207,9 @@ (define (resolve-reference repository ref)
> (let ((oid (reference-target
> (branch-lookup repository branch BRANCH-REMOTE))))
> (object-lookup repository oid)))
> + (('symref . symref)
> + (let ((oid (reference-name->oid repository symref)))
> + (object-lookup repository oid)))
> (('commit . commit)
> (let ((len (string-length commit)))
> ;; 'object-lookup-prefix' appeared in Guile-Git in Mar. 2018, so we
> @@ -320,7 +323,7 @@ (define (reference-available? repository ref)
>
> (define* (update-cached-checkout url
> #:key
> - (ref '(branch . "master"))
> + (ref '(symref . "refs/remotes/origin/HEAD"))
> recursive?
> (check-out? #t)
> starting-commit
> @@ -395,7 +398,7 @@ (define* (latest-repository-commit store url
> (log-port (%make-void-port "w"))
> (cache-directory
> (%repository-cache-directory))
> - (ref '(branch . "master")))
> + (ref '(symref . "refs/remotes/origin/HEAD")))
Do we really need to add “remotes/origin” in there? Or is there a way
to just say HEAD and later specify that we’re talking about the remote
head, as is done fro branches?
We also need to change the defaults in <git-checkout> & co., like Marius did.
Thanks,
Ludo’.
next prev parent reply other threads:[~2020-12-14 12:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 21:02 bug#45187: git download defaults to origin/master Ricardo Wurmus
2020-12-11 23:02 ` Kyle Meyer
2020-12-13 21:52 ` Marius Bakke
2020-12-14 4:49 ` Kyle Meyer
2020-12-14 10:27 ` Ludovic Courtès
2020-12-14 10:28 ` Ludovic Courtès [this message]
2020-12-15 6:07 ` Kyle Meyer
2021-04-08 16:21 ` Ricardo Wurmus
2021-04-09 5:10 ` bug#45187: [PATCH] git: Update cached checkout to the remote HEAD by default Kyle Meyer
2021-04-09 13:50 ` bug#45187: git download defaults to origin/master Ludovic Courtès
2021-04-10 3:50 ` Kyle Meyer
2021-04-10 5:51 ` Kyle Meyer
2021-04-10 19:33 ` Ludovic Courtès
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=87zh2gu1ef.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=45187@debbugs.gnu.org \
--cc=kyle@kyleam.com \
/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).