From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 kLbJOtJf+2WvAgAA62LTzQ:P1 (envelope-from ) for ; Wed, 20 Mar 2024 23:14:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id kLbJOtJf+2WvAgAA62LTzQ (envelope-from ) for ; Wed, 20 Mar 2024 23:14:43 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=b2RqyFk4; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=EI43X+gz; 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=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710972882; 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: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=JmI3DRefrj0Yn5KaZXZhNRRV/j2OGySHTIvC7MC77T8=; b=FldSynTskbNM3Rz4QHvKx9QAqAMC5cDNadMAygO3OF7tUuwpu5XiiJcTpeBTBUp9YWLjm3 2pqskwEzaVtmJN0niQw8jgSP3fS2KKHy+Z8j+3iRAbNY8MhTK9Wjm+Oc1eile1snJDer4O eLA3xNVeQYr/1q+Lx9wKrIBUTW7yyZgsfaLe99X6l7BM1+0El1voqOANmSlJYrvt1WijpT QUoXzPnDA43cNB7dUt6LKNipTyl2HOfKAKw2+THwzo9U3p9p+FL8efmALm0h2XXaBQGHYb oBT7eceYP+4qSBDjoj/vaKM3KxkWrYg/8CFw5/lZScByUyuZX6XW1HF5X85GpA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=b2RqyFk4; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=EI43X+gz; 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=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710972882; a=rsa-sha256; cv=none; b=q8cM9XotuV2y47ZUii0l4/0WtG5PmRunRJC7TXawBlh5S7CF0CnY6Ptp4Sy+Zd//b/t+ee qJOemNIdYD6fKdeK0DE2h8TTJy/Le3Yu8MGvBjbmpGeZOgu9j0ICbUKb7S0seV0OxuEqQS GRxMkNdhEBjvihFgXr4pQZUEkbTVPpEcX8X0wMyGNgp2XXDuwWzpw9WQzslrS25g8IrdIx rtS3uNJKOqbV4rfzSgvDveg2ZwtiqT4yNvaF0wD6WfvWPeoWq/49emXW8+cPMnDybb9pwF 5NOLt9zr308NzGEcW5Tzu2DBBMXYQGC843IbCaGNlsRk3sQmtjUTcbAglMbyDw== 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 2360310977 for ; Wed, 20 Mar 2024 23:14:42 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rn4CW-0004Ss-3d; Wed, 20 Mar 2024 18:14:24 -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 1rn4CU-0004SQ-Cv for guix-patches@gnu.org; Wed, 20 Mar 2024 18:14:22 -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 1rn4CU-0002sz-5B for guix-patches@gnu.org; Wed, 20 Mar 2024 18:14:22 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rn4D7-0002IT-Lx for guix-patches@gnu.org; Wed, 20 Mar 2024 18:15:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69780] [PATCH 1/4] git authenticate: Record introduction and keyring in =?UTF-8?Q?=E2=80=98.git/config=E2=80=99.?= Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Mar 2024 22:15:01 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 69780@debbugs.gnu.org Received: via spool by 69780-submit@debbugs.gnu.org id=B69780.17109728488753 (code B ref 69780); Wed, 20 Mar 2024 22:15:01 +0000 Received: (at 69780) by debbugs.gnu.org; 20 Mar 2024 22:14:08 +0000 Received: from localhost ([127.0.0.1]:36197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rn4CF-0002H7-Ei for submit@debbugs.gnu.org; Wed, 20 Mar 2024 18:14:07 -0400 Received: from wolfsden.cz ([37.205.8.62]:55064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1rn4CD-0002Gx-3W for 69780@debbugs.gnu.org; Wed, 20 Mar 2024 18:14:07 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id D2C132934D4; Wed, 20 Mar 2024 22:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1710972803; bh=xk7IdY+tSDIoKmjAy5HVVc7C9gtCANzvwzs+8U9e2CU=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=b2RqyFk4D5wPltUdoVF5Z3B0yrc+7l738fv1xXRv0PI7tj4TgVP4SLXhid4Rwfi36 r8fGu7WSFc7kH71G7gp2xZ4LXk0Ph27jGRmSmahlK3tAy94t9dG9KBON3nrwPtQ/wc BLcMF/s2nlo+r9yzi9MsErP8zjVW4JZVuEbQEVzFYShEPeQ8X3eZbvqT9XwWDpllkR OS/M+G6Q/bUQO47ntsRjnAXmbnj5epv+eh8KRSxcQitpct6HsgdgfgmqCLrVKciWLA KayQUwOMtK8rKepNb7Gukjx0bD+tXWwc49BR1fcisDXRuH8eDWpXljQATc54k+jfSV rL6EQrkTFnGyAiZfEbIQ9Dfe7hbSicSd7lLQGBvJ9o3pF58ILZDag3O1aNZuvSdFwK eRV2rLX2ZZY8Q5iHew1RU0tgQME4QYwJF+lZZjm3l8dJQ62Si5dTVawsQk+evdFUFR V1og0aFiGQK7GRsWd9rgh3ODyzwcahFi+JNxii3UL0Pb1UvBN4D1+tlKr1epBvqD1U NyARnxNyEa+UThpF+shtwdt+CPweSqg2J6EP9TSxFZMIioFLU9pNznjtEpC7VhIAhh Jgx5NaaFDrsAJg+clUjWh3G1MtelGzybzbjvDKVvSF2bV5L8BuaXzX8x8IwRhFMq2S OPtoJYX55q76gs+vemACM3EQ= Received: from localhost (unknown [81.17.16.82]) by wolfsden.cz (Postfix) with ESMTPSA id D64E4294532; Wed, 20 Mar 2024 22:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1710972802; bh=xk7IdY+tSDIoKmjAy5HVVc7C9gtCANzvwzs+8U9e2CU=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=EI43X+gzuHGhGhDeQ5rinDhj5DvxmOYiuLzsXYSSQFVJyt9AkIRVfV877boNfAwWC PUOrd5gLlPDC9aDh6uH4/5BkwkSFITiFxKyPTDGTOIhpBxH8FEe35t4faDWbLLlUlL ofNN2GCff8k1b2Y+03lIuXZ+lu/PxqWy+mQpsg6sOMTmbi6p4y5/Rwt3COZ9+iSyYh 9ONOiQBu9sr/Llo6T+LkXUI4M0ZR93kPLheLITPVD4SGQzc9QGuiEaauaBCKp8IrBE jzV18C9V1P7lVaAyLLBn7VpllqP6P1Ui8Fflh87bHBAB18zsv2BVxHRcEjdC1HzUpx X4xBJEIBqjssreh70dvYRTvxAaYTFysVkvZqd7/uxdonyfdJgdy4wTtsTxhwHAn6gj P/AMx8vEy56OYAbTK2zfygfJWNWMKh7CziRGJ21p7abjPoBUdrWr7kjFokgbnwoVGc f81g6NZuWxPkYUOieY2bNjGxNSlzTkpsKavaaMRo66oOwz0+UkM/Ltq9nxReQaQGGQ +9qUBwGfnOWbnE8Tv13g3JU9pWy1xTGYQWCD6IxK7UEiKWkxSuB/5ZHbBBX8IAMw6d UGNBbtDHYbv1LRezerEQ6IqkuSHgGbebAV2BltwIDoghR6dZ5xoefdC63vTjLdNLf6 dQasX3Jcv57aRo4ZmhxKjwB0= Date: Wed, 20 Mar 2024 23:13:22 +0100 From: Tomas Volf <~@wolfsden.cz> Message-ID: References: <40858e56cf55b27711d23add5f3cd2ccc6ea5c58.1710351278.git.ludo@gnu.org> <87sf0m4a9s.fsf@gnu.org> <87frwk28ms.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="F9nWdP19H3XWVgkX" Content-Disposition: inline In-Reply-To: <87frwk28ms.fsf@gnu.org> 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-Scanner: mx13.migadu.com X-Migadu-Spam-Score: 1.08 X-Spam-Score: 1.08 X-Migadu-Queue-Id: 2360310977 X-TUID: 4LrphDuqzEJ8 --F9nWdP19H3XWVgkX Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-03-20 17:03:23 +0100, Ludovic Court=C3=A8s wrote: > Hi, > > Ludovic Court=C3=A8s skribis: > > > Tomas Volf <~@wolfsden.cz> skribis: > > > >>> +(define* (record-configuration repository > >>> + #:key commit signer keyring-reference) > >>> + "Record COMMIT, SIGNER, and KEYRING-REFERENCE in the 'config' file= of > >>> +REPOSITORY." > >>> + (define directory > >>> + (repository-directory repository)) > >>> + > >>> + (define config-file > >>> + (in-vicinity directory "config")) > >> > >> I do not think this will work with worktrees. It will create the conf= ig file in > >> the worktree's git directory, but that file will be ignored by git. > >> > >> scheme@(guile-user)> (repository-discover "/home/xx/src/guix-wt/pa= tch-1") > >> $7 =3D "/home/xx/src/guix/.git/worktrees/orig/" > >> scheme@(guile-user)> (repository-open $7) > >> $8 =3D # > >> scheme@(guile-user)> (repository-directory $8) > >> $9 =3D "/home/xx/src/guix/.git/worktrees/orig/" > >> scheme@(guile-user)> (in-vicinity $9 "config") > >> $10 =3D "/home/xx/src/guix/.git/worktrees/orig/config" > >> > >> The $10 should be "/home/xx/src/guix/.git/config" instead. > > > > Damn it. So hmm, I can see two options: > > > > 1. Add more bindings to (git config) in Guile-Git so we can populate > > that file =E2=80=9Cthe right way=E2=80=9D. But then we=E2=80=99ll= have to require that > > newer version of Guile-Git. > > > > 2. Bail out when the =E2=80=98.git/config=E2=80=99 isn=E2=80=99t foun= d, as in the case of > > worktrees; we can change that to use the proper (git config) > > eventually. > > > > Maybe we should go straight to #1 though. Thoughts? > > Done: > > https://gitlab.com/guile-git/guile-git/-/commit/b3be1dd752682b2b6c9a7c1= 1ccdbfc0f0b5cf4e7 > https://gitlab.com/guile-git/guile-git/-/commit/d38c09230467ca5cca7faab= b0c3a43c61a1e2c05 Oh, that looks really nice. > > I can cut a new Guile-Git release soonish and we=E2=80=99d use these new > bindings. > > The only open issue left is branches: how to configure different > introductions for different branches. I=E2=80=99m all ears! Right, so I have few ideas, not sure if they are any good though. And I my= self am not really sure which one I like the most, so... 0. Not care about it. Since the explicit values override the stored ones, = my scripting will still work. 1. Record the success only when on the master branch. That assumes that *m= ost* branches will share authentication parameters with the master. That holds = for my repository (only orig-master branch differs), not sure if generally. 2. Store authentication per branch (guix.authentication.BRANCH. prefix) and periodically clean up stale configuration (if BRANCH no longer exist, delet= e all config for it). 3. Add guix.authenticate.do-not-record config defaulting to false. That wo= uld allow people like me to just turn if off. 4. Store the authentication on *each* success, so last-wins approach. 5. Expand the 2. to allow pattern (regex? or at least list of branches), so= I (as a user) could configure (using git config) which branch should use diff= erent authentication from the globally recorded "default" from master branch (see= 1.). The problem here is that any possible "smart" solution leaves something to = be desired. Either it is not automated enough (new branches are unconfigured)= , or it is too magical (new branches inherit the config from... something). 5. = is probably the most flexible and covering edge cases, but will not be exactly one-line change. Hm, now when I read it after myself, maybe it is just not a problem worth solving. All of these are likely to complicate the code quite a bit. Not = sure. Dunno, was this of any help? :) Tomas -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --F9nWdP19H3XWVgkX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmX7X4IACgkQL7/ufbZ/ wakTZxAAkmZPJ8ZQ5lb4ljkSfxJWx+9XPLbe5xg40Rjm2gS6n2+DO7LfLufMubeY PmXgzoibdHPDjWqEbp2L+wXJW9VLjhpZAFD9lac1OnDgUN7pW0njTbyZ62YbJQun WgNGVProeMNm9bvoypb1jpvLYHzBkFsBEPVeeGuDliVu1jFcA68Nr4ck+2Zpy8ii U3LM2gGO3GCOYu5Qn2FiHPjiLIjaZojF0v0InSwlmkd1V4zkU8xY9nskepOF/UOo JCnQ1IMZnDPUverYTWCKfUq6RdIGdjkovAVrpdedYtyvjphhETA7bd0HNdeFCBNF gU84AyyOZdwtxRgrQ4tTHmxdME5cOj97WIDp9AP2WJR1sxU3HFM/dfR340vkBO8G 7j46MAC7OtD6gZsObVBMsi6DcjDT2aKQluheap9jpHeZKAX6qr/B6BBEtRC1/Ysb qBa2qbKXB4mE1tMmTnvtPwkLNk0dt1W27KueWGcfz86SV2BdVjiw+FhkL66co33D T6QCIY9VkZgccC5dnVXnBGEquEtF3MrbxPFyT3PAbQzSHgSTpNThElm5BlIyEtHQ trGguxY5AbUFClcTcwgZPM3UHtGbX+hRqPVDsmipnIDE9kTo1ZsFtjrKGXaiiOt4 FHcJaZg4qLGgKvhldxQRka2xPehTBjdXIdMW0MDHtZtDS0EhB8c= =X5II -----END PGP SIGNATURE----- --F9nWdP19H3XWVgkX--