From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wIy/DNNbcGA36AAAgWs5BA (envelope-from ) for ; Fri, 09 Apr 2021 15:51:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QC2qBtNbcGCyGwAA1q6Kng (envelope-from ) for ; Fri, 09 Apr 2021 13:51:15 +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 75BB9217D8 for ; Fri, 9 Apr 2021 15:51:14 +0200 (CEST) Received: from localhost ([::1]:52378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUrXV-0000Us-K7 for larch@yhetil.org; Fri, 09 Apr 2021 09:51:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUrXL-0000Ts-Hx for bug-guix@gnu.org; Fri, 09 Apr 2021 09:51:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUrXJ-0002GQ-TK for bug-guix@gnu.org; Fri, 09 Apr 2021 09:51:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lUrXJ-00074j-Qy for bug-guix@gnu.org; Fri, 09 Apr 2021 09:51:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#45187: git download defaults to origin/master Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 09 Apr 2021 13:51: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: Kyle Meyer Received: via spool by 45187-submit@debbugs.gnu.org id=B45187.161797625227182 (code B ref 45187); Fri, 09 Apr 2021 13:51:01 +0000 Received: (at 45187) by debbugs.gnu.org; 9 Apr 2021 13:50:52 +0000 Received: from localhost ([127.0.0.1]:49284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUrXA-00074M-FK for submit@debbugs.gnu.org; Fri, 09 Apr 2021 09:50:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUrX8-000743-Fj for 45187@debbugs.gnu.org; Fri, 09 Apr 2021 09:50:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50956) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUrX2-00027Z-Vo; Fri, 09 Apr 2021 09:50:44 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36960 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lUrX1-0003Xb-CR; Fri, 09 Apr 2021 09:50:43 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <878sa4vyxb.fsf@elephly.net> <875z0wt54x.fsf@kyleam.com> Date: Fri, 09 Apr 2021 15:50:41 +0200 In-Reply-To: <875z0wt54x.fsf@kyleam.com> (Kyle Meyer's message of "Fri, 09 Apr 2021 01:10:22 -0400") Message-ID: <87fszz7ej2.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Ricardo Wurmus , 45187@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617976274; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=rNuwUVa7DjD6ZQlETqPPcAjxpnVd3ScTH3cwv3OpGtM=; b=Ox0Y9jpE2hFqAAkYmzlwWgMs78UwWabkoSQCJKzRs/76CRgR+tSwgNENgLM9zEnmJhwELK ncXF3HmFxdzSaUlVOUb1rmq143xWC89bfnF/BHuIsXhAv7GhVsSHLqKE2QJUcrDpknSlSl j+xstifgMnHqBE429zsjGeqY+8HWeGLQJjz6CGBWBSNZCAhK9sQCtpalrfiv0+Pp6OIVAK 9IemSTCGHNYePJj0WguBPCx0qSc7ElEh4neG3K8yvIauFuzuL4vhyJujc9w41m9fvFImYY w24aYUh7FIRx0Px4omNI4OnDQjaY1l8469sIWlp2vzQqPbOxHXnO08xMFbMLhw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617976274; a=rsa-sha256; cv=none; b=tpmyfBvbS+e4Bf7+SN4n18x0Oi+0HfhtO7PiHUXtjaZLpGIqMRKnLoIM/sUk8y7op8SkEE 2bwAzeljAiAluwh8fdLgdG6I2raR7jETEcdQ6qAjG38oQYPkvJSCgAI3yzMFewDb5E5zlk CSemKcnnZbBlAEved4TxzmavcKKKW1y52Skpdu5lDWPgmdZap8ER/6oh8sfrxKKXHU7PA1 Hozsa0XfCCA3p3TXLGLwutHQUNOjmtZWDH0IJ50LxVTkvNYJurenO/v3saUTYhYTCwvqpB 55gHHZME2/EU9dHxlrtDyshY+ieQTNKOrzUUCs5EROLHBpJN0otmp3yHcDg6Hw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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-Spam-Score: -2.94 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: 75BB9217D8 X-Spam-Score: -2.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: OcMx5+ossqBG Hi! Kyle Meyer skribis: > Subject: [PATCH] git: Update cached checkout to the remote HEAD by defaul= t. > > Fixes . > Reported by Ricardo Wurmus . > > 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 r= emote > 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. > (): Add symref field that defaults to "HEAD", and change br= anch > field's default to #f. > (git-checkout-compiler): Handle symref field of . [...] > 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=E2=80=99s established Git jargon, but =E2=80=9Csymref=E2=80=9D lo= oks obscure to me. I find it OK for =E2=80=98update-cached-checkout=E2=80=99, because it=E2=80= =99s an =E2=80=9Cinternal=E2=80=9D procedure for die-hard hackers, but a bit ugly here. Another option would be to not add this =E2=80=98symref=E2=80=99 field and = instead, when =E2=80=98branch=E2=80=99 and =E2=80=98commit=E2=80=99 are both #f, translat= e that to '(symref . "HEAD"). WDYT? The rest of the patch LGTM, thanks! Ludo=E2=80=99.