all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Kyle Meyer <kyle@kyleam.com>
Cc: Ricardo Wurmus <rekado@elephly.net>, 45187@debbugs.gnu.org
Subject: bug#45187: git download defaults to origin/master
Date: Fri, 09 Apr 2021 15:50:41 +0200	[thread overview]
Message-ID: <87fszz7ej2.fsf_-_@gnu.org> (raw)
In-Reply-To: <875z0wt54x.fsf@kyleam.com> (Kyle Meyer's message of "Fri, 09 Apr 2021 01:10:22 -0400")

Hi!

Kyle Meyer <kyle@kyleam.com> skribis:

> Subject: [PATCH] git: Update cached checkout to the remote HEAD by default.
>
> Fixes <https://bugs.gnu.org/45187>.
> Reported by Ricardo Wurmus <rekado@elephly.net>.
>
> update-cached-checkout hard codes "master" as the default branch, leading to a
> failure when the clone doesn't have a "master" branch.  Instead use the remote
> HEAD symref as an indicator of what the primary branch is.
>
> * guix/git.scm (resolve-reference): Support resolving symrefs.
> (update-cached-checkout, latest-repository-commit): Default to the remote HEAD
> symref.
> (<git-checkout>): Add symref field that defaults to "HEAD", and change branch
> field's default to #f.
> (git-checkout-compiler): Handle symref field of <git-checkout>.

[...]

>    git-checkout make-git-checkout
>    git-checkout?
>    (url     git-checkout-url)
> -  (branch  git-checkout-branch (default "master"))
> +  (branch  git-checkout-branch (default #f))
> +  (symref  git-checkout-symref (default "HEAD"))

I know it’s established Git jargon, but “symref” looks obscure to me.
I find it OK for ‘update-cached-checkout’, because it’s an “internal”
procedure for die-hard hackers, but a bit ugly here.

Another option would be to not add this ‘symref’ field and instead, when
‘branch’ and ‘commit’ are both #f, translate that to '(symref . "HEAD").

WDYT?

The rest of the patch LGTM, thanks!

Ludo’.




  reply	other threads:[~2021-04-09 13:51 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
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           ` Ludovic Courtès [this message]
2021-04-10  3:50             ` bug#45187: git download defaults to origin/master 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fszz7ej2.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=45187@debbugs.gnu.org \
    --cc=kyle@kyleam.com \
    --cc=rekado@elephly.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.