From patchwork Thu Apr 24 08:19:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Garbage X-Patchwork-Id: 41972 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F3F6427BC4B; Thu, 24 Apr 2025 09:21:53 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B6BD527BC49 for ; Thu, 24 Apr 2025 09:21:53 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7rpc-0001VX-ES; Thu, 24 Apr 2025 04:21:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u7rpT-0001UO-VM for guix-patches@gnu.org; Thu, 24 Apr 2025 04:21:08 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7rpT-0001qJ-Aq; Thu, 24 Apr 2025 04:21:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=/ktMa29zsNEHEHV5H7DHvUguOto59dD4i670FE3RW/s=; b=MVeN1sELOZ3NYa41HqkMMve05K5oK6ZyMDIks51TZOZgwk1aASV8g/WEJoIA9gfv8CTYNzwlolFdfi9RKKcX+uc1gd93zUCrRQzXXPaCGQKnuFLJqxiapD0kURh7+hDh4srlBds25tiisyDwnea4lhyhZboFu258k52/WKIi8M5HTfXnfesfcgcMIGeLozCt1XP+BFykvVEq6HrgcbM072DzM2jgCMFKkbdDjU1ruLoPIbl02K8y5gKlJaMuf1hTE6bADh9f+E4mrWeQr9Dg7IDt1BPfCDQuSNwRDxjXl6lJkhVoerBkLiABfUfLdnCdcR4s+2n1RrWxcZc75/iMcg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u7rpR-0003Jr-CL; Thu, 24 Apr 2025 04:21:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78030] [PATCH 2/2] guix: git: Add support for symbolic references. Resent-From: Romain GARBAGE Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 24 Apr 2025 08:21:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78030 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78030@debbugs.gnu.org Cc: ludovic.courtes@inria.fr, Romain GARBAGE , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 78030-submit@debbugs.gnu.org id=B78030.174548283012378 (code B ref 78030); Thu, 24 Apr 2025 08:21:05 +0000 Received: (at 78030) by debbugs.gnu.org; 24 Apr 2025 08:20:30 +0000 Received: from localhost ([127.0.0.1]:35434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7roq-0003D6-25 for submit@debbugs.gnu.org; Thu, 24 Apr 2025 04:20:29 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:35657) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u7rom-0003BL-PC for 78030@debbugs.gnu.org; Thu, 24 Apr 2025 04:20:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/ktMa29zsNEHEHV5H7DHvUguOto59dD4i670FE3RW/s=; b=bsZSPhX7cRCQA75Wn4aVmJ0ck5Z1VOX1LA/l082ZuscqExaan4Uk+uyW +QMmLxJVBC1n0mBQJosxru8rAZRKYLT8ID00zxcX13Rp2LrUZx0TmYl1o aSXLnwzbG/hMtLJRkZz0SGD8VyipKNFVxIjPJi+lyOgfmbqkIkLAw6+NK 4=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=romain.garbage@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.15,235,1739833200"; d="scan'208";a="115047415" Received: from unknown (HELO guix-A102.bordeaux.inria.fr) ([193.50.110.224]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2025 10:20:17 +0200 From: Romain GARBAGE Date: Thu, 24 Apr 2025 10:19:59 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <6d8680624a6d3c0b30bb93adc0b2a2f86b1463f3.1745482799.git.romain.garbage@inria.fr> References: <6d8680624a6d3c0b30bb93adc0b2a2f86b1463f3.1745482799.git.romain.garbage@inria.fr> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/git.scm (update-cached-checkout): Add support for symbolic references. Change-Id: Ib7874e2a30f97e51fdfdc2231a3bc5a3b45a177d --- guix/git.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index 01e0918588..a6d921a8cf 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -563,7 +563,7 @@ (define* (update-cached-checkout url to REF, and the relation of STARTING-COMMIT relative to the new commit (if provided) as returned by 'commit-relation'. -REF is pair whose key is [branch | commit | tag | tag-or-commit ] and value +REF is pair whose key is [branch | commit | symref | tag | tag-or-commit ] and value the associated data: [ | | | ]. If REF is the empty list, the remote HEAD is used. @@ -599,6 +599,11 @@ (define* (update-cached-checkout url (string-append "origin/" branch)))) (_ ref))) + (define symref-list + (match ref + (('symref . symref) (list symref)) + (_ '()))) + (with-libgit2 (set-git-timeouts connection-timeout read-timeout) (let* ((cache-exists? (openable-repository? cache-directory)) @@ -613,7 +618,10 @@ (define* (update-cached-checkout url (remote-fetch (remote-lookup repository "origin") #:fetch-options (make-default-fetch-options #:verify-certificate? - verify-certificate?))) + verify-certificate?) + ;; Symbolic references are not fetched from the remote by + ;; default. + #:refspecs symref-list)) (when recursive? (update-submodules repository #:log-port log-port #:fetch-options