From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 14KAOs1S2F+sBwAA0tVLHw (envelope-from ) for ; Tue, 15 Dec 2020 06:08:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UKL6Nc1S2F/nZQAAbx9fmQ (envelope-from ) for ; Tue, 15 Dec 2020 06:08:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 507D7940429 for ; Tue, 15 Dec 2020 06:08:13 +0000 (UTC) Received: from localhost ([::1]:38998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kp3VL-0002Np-Pc for larch@yhetil.org; Tue, 15 Dec 2020 01:08:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kp3VC-0002Nd-CL for bug-guix@gnu.org; Tue, 15 Dec 2020 01:08:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kp3VC-0000tN-49 for bug-guix@gnu.org; Tue, 15 Dec 2020 01:08:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kp3VB-00059d-Tf for bug-guix@gnu.org; Tue, 15 Dec 2020 01:08:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45187: git download defaults to origin/master Resent-From: Kyle Meyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 15 Dec 2020 06:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45187 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 45187-submit@debbugs.gnu.org id=B45187.160801244119764 (code B ref 45187); Tue, 15 Dec 2020 06:08:01 +0000 Received: (at 45187) by debbugs.gnu.org; 15 Dec 2020 06:07:21 +0000 Received: from localhost ([127.0.0.1]:55094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kp3UX-00058h-GJ for submit@debbugs.gnu.org; Tue, 15 Dec 2020 01:07:21 -0500 Received: from out1.migadu.com ([91.121.223.63]:43032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kp3UU-00058Y-R8 for 45187@debbugs.gnu.org; Tue, 15 Dec 2020 01:07:20 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1608012437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WPDFu2Hm7tgFMC80KCn+LPz8ajeeC4Zj3PXQiux/6Cw=; b=BPRuVa8IZaHonLrWJThp5Dsoox2BjA1alKR/DedvSxCL7xMUOZPVAMZhEini6WssU/7nFW jc5FCg1STaNSSk8rkY9XvdnGzMie60pa5XV7iZANfLaxWVMKeIkVrSlFLVZSlB3jVHsIp1 laZO5XdCbea8DzNGLU6WGe9BrJR1Rrs+xU3A8cD21wzfsAqxgOXtL/dP1f8sEJL578ETA4 Ysk6Dg+6Ai+rAgKhNoCDPf+GaiUVbcUc6X7dgnXzYv5jWasdLHPKjAL3O3ME7hUTT0ndlR QHfQOAqQN02Nv5WfGWKqqdDq31mcOqx901tS01ddXeWnZwrto7zaYHzCvPB4XQ== From: Kyle Meyer In-Reply-To: <87zh2gu1ef.fsf@gnu.org> References: <878sa4vyxb.fsf@elephly.net> <87v9d8dk0r.fsf@kyleam.com> <87zh2gu1ef.fsf@gnu.org> Message-ID: <87wnxj7gbw.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: kyle@kyleam.com Date: Tue, 15 Dec 2020 06:07:17 GMT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 45187@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=kyleam.com header.s=key1 header.b=BPRuVa8I; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 507D7940429 X-Spam-Score: -1.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: gxrVMBF0jUnZ Ludovic Court=C3=A8s writes: >> (define* (update-cached-checkout url >> #:key >> - (ref '(branch . "master")) >> + (ref '(symref . "refs/remotes/origin/H= EAD")) >> 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 =E2=80=9Cremotes/origin=E2=80=9D in there? Or i= s there a way > to just say HEAD and later specify that we=E2=80=99re talking about the r= emote > head, as is done fro branches? Thanks for the feedback. Sure, that sounds fine to me. As far as I can tell, in this context it'd make sense to assume HEAD should always be the one under refs/remotes/origin. (It really was a "quick check that my suggestion to use the remote HEAD symref works" sort of patch :)) Another thing that doesn't feel suitable for the proper patch is the introduction of the `symref' symbol... > We also need to change the defaults in & co., like Marius = did. ...which didn't seem particularly nice to add as a field to . However, without the introduction of something like `symref', I'm not spotting a straightforward way to deal with refs/remotes/origin/HEAD in resolve-reference. FWIW if we were to go in the direction Marius suggested, I believe the main change needed on top of Marius's patch in order to use the remote symref would be diff --git a/guix/git.scm b/guix/git.scm index 0c49859e42..5caf715916 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -313,9 +313,7 @@ (define* (update-cached-checkout url (('branch . branch) `(branch . ,(if (string-prefix? "origin/" branch) branch - (if (string=3D? "HEAD" branch) - branch - (string-append "origin/" branch))))) + (string-append "origin/" branch)))) (_ ref))) =20 (with-libgit2