From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id mO3pK3IYC2Z6awAAqHPOHw:P1 (envelope-from ) for ; Mon, 01 Apr 2024 22:26:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id mO3pK3IYC2Z6awAAqHPOHw (envelope-from ) for ; Mon, 01 Apr 2024 22:26:26 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=PG9LfvDU; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712003186; 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:dkim-signature; bh=5Bpm9i/CLHhv31C1rAdprAEtyu3N+38RkNqUCQAmL4M=; b=QA+QnNeaBjGzmTf/13hhbmiLjwoKTIUQPXYMxgyKHX4lS3LOft79Me2+843WhC2hGu4Px5 xhm4QP7dPTi8DYzmdG+zBgolGSvnmj0RSHmgosa6sUZla6FE2RfRILdnPGtQiQOGscdQd8 WgLzM+sAB0B1RF529hIRxi6CJgAirR7gPe/hrl2MGPmJJDUCG4MZ+SQiyNhN3ccJvkPfNj aj6gEpDz1BCR8mPJ8s/xX0rcSu+ObJfJ5DsnFavoI/4oalex4Yu4SQr6p6BHTmNtVLVNoR A35rLGo2DaQ0q91gS5JHgjsB0yKYHVWmpM3KxlMM9r1kW81vWmxI43SCi+ht7Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=PG9LfvDU; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712003186; a=rsa-sha256; cv=none; b=FDoi8amaOARqm/HQTjL0n9uolBPd1h9ByKCZYo3R7RumXa0wB0maH2xWaSs1Y1WhIbdT8G rt/t8HyA8W8vTvlH3uU3GmhAYGMdjy6y0qcmBLjNGQnGZOqS0665eAyNyVDirx1t4PqWVH /b3YU5MnQm8eO3xFaC9vsZra6J1mVekTYm7qGA467HXyVjxz3fi+dNdBVa/PRwjxzcgvp5 G1AqLC200ivmt7igJ7cU3SbdAjH8tfXQF65JLj9MGszLCwX5B2SQ4QJilQ+6LGTt+KGnLl kE049MI6Z5Kou4nlKObdMDjYTe/xr5cdS2x7YIVAa369zoDX/cjFXYavUCVqpg== 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 91D153D118 for ; Mon, 1 Apr 2024 22:26:26 +0200 (CEST) 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?Q?=E2=80=98commit-short-id=E2=80=99?= 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -4.55 X-Migadu-Queue-Id: 91D153D118 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -4.55 X-TUID: yWvUARBZAqZ7 * 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." -- 2.41.0