From patchwork Mon Apr 1 20:25:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 62442 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 E012827BBEA; Mon, 1 Apr 2024 21:26:27 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 6B56A27BBE2 for ; Mon, 1 Apr 2024 21:26:26 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrOEE-00082f-0d; Mon, 01 Apr 2024 16:26:02 -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 1rrOEC-00082O-K0 for guix-patches@gnu.org; Mon, 01 Apr 2024 16:26:00 -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 1rrOEC-0006oJ-9Z; Mon, 01 Apr 2024 16:26:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rrOEF-0007HE-F2; Mon, 01 Apr 2024 16:26:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70132] [PATCH 03/11] channels: Move =?utf-8?b?4oCYY29tbWl0LXNo?= =?utf-8?b?b3J0LWlk4oCZ?= to (guix git). Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 01 Apr 2024 20:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70132 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70132@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 70132-submit@debbugs.gnu.org id=B70132.171200315427912 (code B ref 70132); Mon, 01 Apr 2024 20:26:03 +0000 Received: (at 70132) by debbugs.gnu.org; 1 Apr 2024 20:25:54 +0000 Received: from localhost ([127.0.0.1]:51657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrOE6-0007G7-8W for submit@debbugs.gnu.org; Mon, 01 Apr 2024 16:25:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrOE4-0007FV-MV for 70132@debbugs.gnu.org; Mon, 01 Apr 2024 16:25:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrODw-0006ls-1M; Mon, 01 Apr 2024 16:25:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=5Bpm9i/CLHhv31C1rAdprAEtyu3N+38RkNqUCQAmL4M=; b=PG9LfvDUTIFRQon9333j ok/0SyHCLQ/0AP81K+NJZsOjCNTjhkZWjOtjgFJ5ZQbBN7WiCZ2jhk/PVulZt+X1PVwLnYl9ovMo/ Ayzne8yDVlsQ9HSak/0Vg5+8yYP40Yu28WoOME1ahEbvu9Iq4Rztquycap4krMvbtJAuevSZazyzK Xau8D8Y3ZT3z89qFuoEki+XRc1WPJC4piiDicBDdtIwJoOhhTpL+juewejydVsFtbVmc7JYoNnXHN fyYyB+ayXh7O99OdXW2cbRDINRXsx2QrGrjagl4V3wyza148BTDh4q/lBuPF89pifbv37oqUkwfpy CZMiiv06c4fvdQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 1 Apr 2024 22:25:15 +0200 Message-ID: <40070393934abb8d6a785857dc3806217e64817b.1712002698.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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 (commit-short-id): Move to… * guix/git.scm (commit-short-id): … here. Change-Id: If4b34b1d82b1aa5068d157f26e57e8aecc967061 --- guix/channels.scm | 4 +--- guix/git.scm | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index f26ccbc3ae..0b776ab211 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -25,6 +25,7 @@ (define-module (guix channels) url+commit->name commit-difference repository-info + commit-short-id with-repository) #:autoload (guix git-authenticate) (authenticate-repository) #:autoload (guix openpgp) (openpgp-public-key-fingerprint @@ -339,9 +340,6 @@ (define (apply-patches checkout commit patches) (apply-patch patch checkout)) (loop rest))))) -(define commit-short-id - (compose (cut string-take <> 7) oid->string commit-id)) - (define* (authenticate-channel channel checkout commit #:key (keyring-reference-prefix "origin/")) "Authenticate the given COMMIT of CHANNEL, available at CHECKOUT, a diff --git a/guix/git.scm b/guix/git.scm index 760b064a9c..eab84ea798 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -67,6 +67,7 @@ (define-module (guix git) commit-relation commit-descendant? commit-id? + commit-short-id remote-refs @@ -233,6 +234,9 @@ (define (commit-id? str) (and (= (string-length str) 40) (string-every char-set:hex-digit str))) +(define commit-short-id + (compose (cut string-take <> 7) oid->string commit-id)) + (define (resolve-reference repository ref) "Resolve the branch, commit or tag specified by REF, and return the corresponding Git object."