From patchwork Mon Feb 14 10:33:59 2022 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: 37238 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 D68B127BBEA; Mon, 14 Feb 2022 10:36:51 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,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 A3FC227BBE9 for ; Mon, 14 Feb 2022 10:36:51 +0000 (GMT) Received: from localhost ([::1]:59908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJYiw-0002T5-SL for patchwork@mira.cbaines.net; Mon, 14 Feb 2022 05:36:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJYhG-0000ST-Bn for guix-patches@gnu.org; Mon, 14 Feb 2022 05:35:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJYhC-0008Kb-Hv for guix-patches@gnu.org; Mon, 14 Feb 2022 05:35:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJYhC-0001zr-DL for guix-patches@gnu.org; Mon, 14 Feb 2022 05:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53608] [PATCH 0/2] Rejecting commits unrelated to the introductory commit Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Feb 2022 10:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53608 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch security To: Maxime Devos Cc: Attila Lendvai , 53608@debbugs.gnu.org Received: via spool by 53608-submit@debbugs.gnu.org id=B53608.16448348497582 (code B ref 53608); Mon, 14 Feb 2022 10:35:02 +0000 Received: (at 53608) by debbugs.gnu.org; 14 Feb 2022 10:34:09 +0000 Received: from localhost ([127.0.0.1]:39921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJYgL-0001yC-6M for submit@debbugs.gnu.org; Mon, 14 Feb 2022 05:34:09 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:34874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJYgI-0001xh-Qv for 53608@debbugs.gnu.org; Mon, 14 Feb 2022 05:34:07 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 49C32B12; Mon, 14 Feb 2022 11:34:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bGr4uSXyWvWd; Mon, 14 Feb 2022 11:34:00 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 202A528B; Mon, 14 Feb 2022 11:34:00 +0100 (CET) From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <20220128173142.7072-1-ludo@gnu.org> <87leyl7yj0.fsf@gnu.org> <2ff5b7962c1258f94554f23128385c593a3ee9de.camel@telenet.be> Date: Mon, 14 Feb 2022 11:33:59 +0100 In-Reply-To: <2ff5b7962c1258f94554f23128385c593a3ee9de.camel@telenet.be> (Maxime Devos's message of "Thu, 10 Feb 2022 23:29:25 +0100") Message-ID: <87tud1ybxk.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 49C32B12 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] 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" X-getmail-retrieved-from-mailbox: Patches Hi, Maxime Devos skribis: > Ludovic Courtès schreef op wo 09-02-2022 om 00:02 [+0100]: >> Howdy Maxime & Attila, >> >> Did you have a chance to look into this series? >> >>   https://issues.guix.gnu.org/53608 >> >> It’s relatively simple but I’d rather have other eyeballs looking at it. >> >> TIA. :-) > > The concept seems reasonable to me but I cannot tell if the > implementation is good or bad. OK. I went ahead and pushed these two commits: ca87601dd9 git-authenticate: Ensure the target is a descendant of the introductory commit. 87d49346f3 git: Add 'commit-descendant?'. The actual change is this extra condition: I encourage everyone to take a look. Thanks, Ludo’. @@ -426,6 +428,17 @@ (define commits (verify-introductory-commit repository keyring start-commit signer)) + ;; Make sure END-COMMIT is a descendant of START-COMMIT or of one of + ;; AUTHENTICATED-COMMITS, which are known to be descendants of + ;; START-COMMIT. + (unless (commit-descendant? end-commit + (cons start-commit + authenticated-commits)) + (raise (formatted-message + (G_ "commit ~a is not a descendant of introductory commit ~a") + (oid->string (commit-id end-commit)) + (oid->string (commit-id start-commit))))) + (let ((stats (call-with-progress-reporter reporter (lambda (report)