From patchwork Thu Apr 24 08:19:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain GARBAGE X-Patchwork-Id: 41973 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 9EA3427BC4A; Thu, 24 Apr 2025 09:22:01 +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 7DA8F27BC49 for ; Thu, 24 Apr 2025 09:22:01 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7rpc-0001Vf-Lx; 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-0001UF-9F 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 1u7rpS-0001qC-Tv; 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:Date:From:To:In-Reply-To:References:Subject; bh=+W6WDXIiC5Vv2tAhS7kHU7qQYWKoCqiepWWhnUvUqMM=; b=t4ZABBFgooNI5w1IuePwwrPCSBYedbIhWjDR0ZiFsNWqbIGA5F0inPUUQPuGR9r8ymxi53H2JA3Ks2XhVnRYn0UZ7+3RXZT9xGAiT9ej7SR6bmvBL7X9rAbRqD3rJCKNt4ev8L2JyOlJ8PgHzEz6Id1Xww8ncsrxkVfHmHzzhL/X+YqQfWBjgJq0/cUuv/KSmjtx0gWbuDX/3WWvQZ63LGAIcAyDYitB0OVBd8EqUxAnY1CCKF+jM0VZicLxIlE043LJEuywwCAivEoXzZeqPqUaW7IxvD3wrPa8h4gWBbXyKSJPwVoFDHl5j3uXWAMf95JcTDY1TcTPAYJ+acYdNQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u7rpQ-0003JV-3O; Thu, 24 Apr 2025 04:21:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78030] [PATCH 1/2] guix: channels: Add symref support. References: In-Reply-To: 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:04 +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.174548282812347 (code B ref 78030); Thu, 24 Apr 2025 08:21:04 +0000 Received: (at 78030) by debbugs.gnu.org; 24 Apr 2025 08:20:28 +0000 Received: from localhost ([127.0.0.1]:35432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7rop-0003Cz-A4 for submit@debbugs.gnu.org; Thu, 24 Apr 2025 04:20:27 -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 1u7rol-0003BL-70 for 78030@debbugs.gnu.org; Thu, 24 Apr 2025 04:20:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+W6WDXIiC5Vv2tAhS7kHU7qQYWKoCqiepWWhnUvUqMM=; b=kzaJWGJk9X9SllxGhyENkUHWhyS4yqBrIQIU+8JF+5K0pALgO2aiURuA XBM94qibiUoqPim/A55gw4emWizmWN13uWOXpPa4mx77KPa2gw6ijKquu SbSWhJXOYg8DLTUpMz+/0G+USryxMH+/QVV9UlgnakC15T6H5bcJV40BW 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="115047411" 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:58 +0200 Message-ID: <6d8680624a6d3c0b30bb93adc0b2a2f86b1463f3.1745482799.git.romain.garbage@inria.fr> X-Mailer: git-send-email 2.49.0 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/channels.scm (channel-reference): Add symref support. Change-Id: Iea93aa22479ec21900af947c4df79a3ed97b5e62 --- guix/channels.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) base-commit: b12d44dd5e35ac236bf3fbb5619b9c8c2f42c902 diff --git a/guix/channels.scm b/guix/channels.scm index 4700f7a45d..72450da395 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -250,7 +250,13 @@ (define (channel-reference channel) "Return the \"reference\" for CHANNEL, an sexp suitable for 'latest-repository-commit'." (match (channel-commit channel) - (#f `(branch . ,(channel-branch channel))) + (#f (let ((branch (channel-branch channel))) + (cond + ((and (string? branch) + (string-prefix? "refs/" + branch)) + `(symref . ,branch)) + (#t `(branch . ,branch))))) (commit `(tag-or-commit . ,(channel-commit channel))))) (define sexp->channel-introduction 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