From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iPdhKNOd+WX60QAAe85BDQ:P1 (envelope-from ) for ; Tue, 19 Mar 2024 15:14:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id iPdhKNOd+WX60QAAe85BDQ (envelope-from ) for ; Tue, 19 Mar 2024 15:14:43 +0100 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=kas3uznJ; 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=1710857683; 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=ozDcReHTikOLG5FmTNR2IdQo6QGME83kA6GRsdVDLVI=; b=JhRKgWim9YfpkmcFemi75pCBayds4gBw/zaPlgL5rfrPzotgj1Ty/wsl/9sSJ6i3tIBY5F T7814TzlLz30MdfqmkmGOzKh/Jk8dGsFU450RvBa148vmMiulDV4OQLEG4gTReXbiw1teC Rm9W+mdAsA6nOo4iE8nQW9HZSDPQjG65GC+1g6d54hCdAyGTfHpblQfgJYS0wnRV5Gb0lc aWZh7lvi3P0bsRYogGV7Cn/eEWTqzX9b3YmOOxqlCYEoq7WcqGDrSPMz1yYrelBcskJhsV T4SBmsccQZloTwqPxjBrUoNaKVQoJjfG1ddj2E3HcNB+2D0jTYgn5skH3kdiJw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710857683; a=rsa-sha256; cv=none; b=dBqcZq4Vayp7nxWBKR4WN2eXJaatCDgvoZIE57TEbKTgbntrwqABYZf+OPo7wLciEZukzU fecbrXETjRqs6FmrPUJH2hk3GObW5HtLpBjCDaW9cZKZqDcJXtNGQSZrAEnmzwshNSEBim 1sIIEYx4P3day8Sr6tSgpsqRJzpcd/0TB1A0mDyetH2uPNQU0FXtHqZiZ/zJQSTb7kgV63 eIv1OtED1HEj5t3SEBbpjnAomqVS27qX5Fj6VK/gxLNqTq/e0so+LFEPyH5ZmYp0JjZwjZ yzjiPzvVN7eFAT5C8b4IZ2Wdn4gvdUAUZ8MYzdkLPKZZaOmII/UV0NG3Zu6kxQ== 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=kas3uznJ; 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 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 3FCF368041 for ; Tue, 19 Mar 2024 15:14:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmaEa-0001R2-9s; Tue, 19 Mar 2024 10:14:32 -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 1rmaDT-00015y-Nr for guix-patches@gnu.org; Tue, 19 Mar 2024 10:13:24 -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 1rmaDT-0002bu-Cf for guix-patches@gnu.org; Tue, 19 Mar 2024 10:13:23 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rmaE6-00040w-39 for guix-patches@gnu.org; Tue, 19 Mar 2024 10:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69780] [PATCH 4/4] DRAFT news: Add entry for =?UTF-8?Q?=E2=80=98guix?= git =?UTF-8?Q?authenticate=E2=80=99?= changes. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Mar 2024 14:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69780 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Skyler Ferris Cc: 69780@debbugs.gnu.org, Julien Lepiller , Florian Pelz Received: via spool by 69780-submit@debbugs.gnu.org id=B69780.171085763615412 (code B ref 69780); Tue, 19 Mar 2024 14:14:02 +0000 Received: (at 69780) by debbugs.gnu.org; 19 Mar 2024 14:13:56 +0000 Received: from localhost ([127.0.0.1]:50993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmaDw-00040S-EI for submit@debbugs.gnu.org; Tue, 19 Mar 2024 10:13:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmaDp-0003zd-Oq for 69780@debbugs.gnu.org; Tue, 19 Mar 2024 10:13:51 -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 1rmaD2-0002UI-Iy; Tue, 19 Mar 2024 10:12:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ozDcReHTikOLG5FmTNR2IdQo6QGME83kA6GRsdVDLVI=; b=kas3uznJRq9m4GAma1dT BEgccqz9p8CF0piYWta88EyhBNcvCwcSxAKBxLX5CVc0iG23Gus90Z8419br5zE0hb4W0AYUbIOn6 FQH7cqpOLGCi9t1tzU4iuNgFw+smiMv7AwJWUW5ZVWChe1PyoW63qYks+/GRW5cdbnjj3LSPv9RaW xn4xtL32w7zP1ChgXl7AizJvtCye5NNEkODir7PBqXfCvU1TMUBmtBSLaL7OxABKsk+W/WzhGjAZB PRLtqW9jXxRGQiIszCpFw3KASXoPaNQNJpAZy1TuwAPqbteJWKnALBQnYS9hxLw+QG70lzzoH9zMq Xw0L1lVVy4McpA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <73ead80c-9159-4e03-b2a7-68434cade060@protonmail.com> (Skyler Ferris's message of "Fri, 15 Mar 2024 00:58:03 +0000") References: <73ead80c-9159-4e03-b2a7-68434cade060@protonmail.com> Date: Tue, 19 Mar 2024 15:12:46 +0100 Message-ID: <8734sm48f5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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: 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.21 X-Spam-Score: -7.21 X-Migadu-Queue-Id: 3FCF368041 X-Migadu-Scanner: mx11.migadu.com X-TUID: bheXOC4d39YD Hi Skyler, Skyler Ferris skribis: >> + (if (or (file-exists? pre-push-hook) >> + (file-exists? fpost-checkout-hook)) >> + (begin >> + (warning (G_ "not overriding pre-existing hooks '~a' and '~a'~%= ") >> + pre-push-hook post-checkout-hook) >> + (display-hint (G_ "Consider running @command{guix git authentic= ate} >> +from your pre-push and update hooks so your repository is automatically >> +authenticated before you push or receive updates."))) > > When the developer builds guix a pre-push hook is already installed, > from etc/git/pre-push. Right. Like I wrote when replying to Tomas, I view this as a helper primarily for people outside Guix itself, because Guix already has its own hooks installed as you write. We could discuss what to do with Guix=E2=80=99s own hooks, but to me that= =E2=80=99s a separate issue. >> + (define post-checkout-hook >> + (in-vicinity directory "hooks/post-checkout")) > > The post-checkout hook does not run when `git pull` is called. Instead, t= he post-merge hook is called. Note that post-merge does not receive the sam= e set of arguments as post-checkout. I had success replacing "$newrev" with= "$(git rev-parse HEAD)". We could leave out the value completely for post-= merge because the script will use HEAD by default if no end is given. But m= aybe we don't want to rely on default behavior for a script that will not b= e automatically updated with the tool. > > I can think of more ways that a developer could end up on a new commit. F= or example, running `git fetch` followed by `git reset --hard`. I'm not sur= e if it makes to support every possible case because that could get complic= ated very quickly. But git pull is the most common way to get updates (at l= east in my experience, which could have a sample bias) so I think it makes = sense to at least support that. I spent time looking for the =E2=80=9Cright=E2=80=9D hook and couldn=E2=80= =99t find anything really satisfying. Ideally, I=E2=80=99d want a hook that runs on =E2=80=98= fetch=E2=80=99, for each new reference. Is post-merge better than post-checkout? githooks(5) says =E2=80=98post-me= rge=E2=80=99 =E2=80=9Cis invoked by git-merge(1), which happens when a git pull is done = on a local repository.=E2=80=9D Is it actually invoked when =E2=80=98git pull= =E2=80=99 does *not* trigger a merge? >> +while read local_ref local_oid remote_ref remote_oid >> +do >> + guix git authenticate --end=3D\"$local_ref\" >> +done\n") > > I believe this should be "$local_oid", not "$local_ref". Oops, noted. >> +(define (configured-introduction repository) >> + "Return two values: the commit and signer fingerprint (strings) as >> +configured in REPOSITORY. Error out if one or both were missing." >> + (let* ((config (repository-config repository)) >> + (commit (config-value config "guix.authentication.introduction= -commit")) >> + (signer (config-value config "guix.authentication.introduction= -signer"))) >> + (unless (and commit signer) >> + (leave (G_ "unknown introductory commit and signer~%"))) >> + (values commit signer))) > > I am wondering how this would work if somebody is working with multiple b= ranches, in particular if they do not all use the same introduction. Maybe = that doesn't need to be addressed in this patch series but it might be easi= er to address it in the future if the branch name was included in the confi= g file instead assuming that a specific introduction applies to every branc= h in a given checkout (for example, by using "guix.authentication.introduct= ion-commit.branch-name"). This is probably more relevant to external users = of the tool than to the guix repository itself. The logistics of using unre= lated branches simultaneously seems complicated and not very helpful, espec= ially when channels are such an appealing alternative. But it could be usef= ul for other projects. Very good point. Now, what would it look like? Currently we have: --8<---------------cut here---------------start------------->8--- [guix "authentication"] introduction-commit =3D 9edb3f66fd807b096b48283debdcddccfea34bad introduction-signer =3D BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A3= 3A 54FA keyring =3D keyring --8<---------------cut here---------------end--------------->8--- Using this configuration format, it seems there=E2=80=99s no room left for a branch name, or am I overlooking something? Or we could take the risk of removing =E2=80=98guix=E2=80=99 and make it: --8<---------------cut here---------------start------------->8--- [authentication "master"] introduction-commit =3D 9edb3f66fd807b096b48283debdcddccfea34bad introduction-signer =3D BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A3= 3A 54FA keyring =3D keyring --8<---------------cut here---------------end--------------->8--- WDYT? Thanks for your feedback! Ludo=E2=80=99.