From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH 0/2] Use 'graph-descendant?' from Guile-Git instead of custom code 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 17 Apr 2025 20:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77875@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tomas Volf <~@wolfsden.cz>, Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.174492123724273 (code B ref -1); Thu, 17 Apr 2025 20:21:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Apr 2025 20:20:37 +0000 Received: from localhost ([127.0.0.1]:48566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5Viv-0006JQ-0m for submit@debbugs.gnu.org; Thu, 17 Apr 2025 16:20:37 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49518) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5Vip-0006Ha-08 for submit@debbugs.gnu.org; Thu, 17 Apr 2025 16:20:34 -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 1u5Vic-0005fZ-Ii for guix-patches@gnu.org; Thu, 17 Apr 2025 16:20:24 -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 1u5ViZ-0000bB-67; Thu, 17 Apr 2025 16:20:16 -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:Subject:To:From:in-reply-to: references; bh=dG+m/YzPYlKGgbqTnFfMXWVM4r0gWRNR3YXE+eeh/Z0=; b=P/Yn1/D/2K4O41 Y5YBGI/YpTS6CDJINajpBLl6zgJ+s6PQoRwSLcoB6OwuuGAQLD8ZXGNx5+IyZE7W211u8E4biOi42 PuWBoPlQcbPCnnYnrgKh3POTytoY5Slnz3EzmPFDfXXR4e2h8QM2Zm1q9mRoZ/efiVDzQmmAikuLz KIf1M3JSyThBdUCSVWbznmS/L7MzwEW51oFfSLFBEDOHfWHnKQykehi3ZZrxOZS11DaiKxQEeFdBR VOs286DXVAiSuKxyK4OEacnU/W+W6Ofh1a2DNkX/DdSTPuikuK74yLgJ/SCEoRcvqbxucVmEjRM7k DtZfjdQa6GYlIdhXeu7g==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 17 Apr 2025 22:19:58 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, This is a bug fix and potentially a performance improvement (I didn’t attempt to benchmark it but if someone wants to do it, I’m curious!). Note that the existing code is kept around for now. We can remove it in a couple of months when Guile-Git 0.10.0 is considered widespread enough. This is a convenience for developers since in practice Guix itself will have switched to Guile-Git 0.10.0 within a few hours. Thanks, Ludo’. Ludovic Courtès (2): git: Use ‘graph-descendant?’ from Guile-Git >= 0.10.0 when available. git: Remove compatibility shim for Guile-Git <= 0.5.2. guix/git.scm | 90 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 38 deletions(-) base-commit: 4bd2949cfa7a8bf5dfe66adad1a76472af09708d -- 2.49.0 From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH 1/2] git: Use =?UTF-8?Q?=E2=80=98graph-descendant=3F=E2=80=99?= from Guile-Git >= 0.10.0 when available. 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 17 Apr 2025 20:24:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77875@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tomas Volf <~@wolfsden.cz>, Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77875-submit@debbugs.gnu.org id=B77875.174492139926062 (code B ref 77875); Thu, 17 Apr 2025 20:24:08 +0000 Received: (at 77875) by debbugs.gnu.org; 17 Apr 2025 20:23:19 +0000 Received: from localhost ([127.0.0.1]:48583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5VlU-0006m0-MQ for submit@debbugs.gnu.org; Thu, 17 Apr 2025 16:23:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52368) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5Vl6-0006gM-7l for 77875@debbugs.gnu.org; Thu, 17 Apr 2025 16:22:54 -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 1u5Vkz-00019v-Ug; Thu, 17 Apr 2025 16:22:46 -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=Ek0b6MjAtxP2i7+AFFBK7M+srxS3Ru7MceiyMIc9GPM=; b=Yr/wT4OQ/2j+grB4K4Lf H9QUJ8/o9QalRbKCFPYNwYZtQq0myc9lCi3d2Gt+YC8D0y7bbv0KOoNCkEk2/baY0V5oavTvBr4Gr xQdJbmUSrZcChRASPe37A0AXduYQMq5HPrBNEC+EQ0SpkybpncMc/FNP0NjDM4Cky9mwb0Ovhe003 6s9/2QLFyyu6p+lK5q7HHxqzaBMpwuuUPcwek4Kj5cB1fqRYZrz8Ji4Zi5Jj8FwYkRMzEwp0DGmSe LmAVRo7Gcy5aHD7lnwjloKtbNg2SeMwEVZYtF9prsSQJ1W5dTFSXzNPqf0USzUIyD5rm1T5nxJuv+ MQl15mCJWnW0KA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 17 Apr 2025 22:22:36 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Fixes . Fixes a bug whereby ‘commit-relation’ and ‘commit-descendant?’ would provide an incorrect result when two distinct objects would exist for the same commit, which can happen when the commit’s metadata is beyond 4 KiB, as of libgit2 1.8/1.9. This, in turn, would lead ‘guix pull’ & co. to wrongfully report an attempt to downgrade and pull to an unrelated commit. * guix/git.scm (commit-relation): When (guix graph) is available, rewrite in terms of ‘graph-descendant?’. (commit-descendant?): Likewise. Change-Id: Ie52b188a8dfa90c95a73387c3ab2fdd04d2bf3e9 Reported-by: Tomas Volf <~@wolfsden.cz> --- guix/git.scm | 83 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 31 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index 01e0918588..cb26714d2d 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -732,7 +732,7 @@ (define (print-git-error port key args default-printer) ;;; Commit difference. ;;; -(define* (commit-closure commit #:optional (visited (setq))) +(define* (commit-closure commit #:optional (visited (setq))) ;to remove "Return the closure of COMMIT as a set. Skip commits contained in VISITED, a set, and adjoin VISITED to the result." (let loop ((commits (list commit)) @@ -768,39 +768,60 @@ (define* (commit-difference new old #:optional (excluded '())) (cons head result) (set-insert head visited))))))) -(define (commit-relation old new) - "Return a symbol denoting the relation between OLD and NEW, two commit +(define commit-relation + (if (resolve-module '(guix graph) #:ensure #f) ;Guile-Git >= 0.10.0 + (lambda (old new) + "Return a symbol denoting the relation between OLD and NEW, two commit objects: 'ancestor (meaning that OLD is an ancestor of NEW), 'descendant, or 'unrelated, or 'self (OLD and NEW are the same commit)." - (if (eq? old new) - 'self - (let ((newest (commit-closure new))) - (if (set-contains? newest old) - 'ancestor - (let* ((seen (list->setq (commit-parents new))) - (oldest (commit-closure old seen))) - (if (set-contains? oldest new) - 'descendant - 'unrelated)))))) + (let ((repository (commit-owner old)) + (old (commit-id old)) + (new (commit-id new))) + (cond ((graph-descendant? repository new old) + 'ancestor) + ((oid=? old new) + 'self) + ((graph-descendant? repository old new) + 'descendant) + (else 'unrelated)))) + (lambda (old new) ;remove when Guile-Git 0.10.0 is widespread + (if (eq? old new) + 'self + (let ((newest (commit-closure new))) + (if (set-contains? newest old) + 'ancestor + (let* ((seen (list->setq (commit-parents new))) + (oldest (commit-closure old seen))) + (if (set-contains? oldest new) + 'descendant + 'unrelated)))))))) -(define (commit-descendant? new old) - "Return true if NEW is the descendant of one of OLD, a list of commits. - -When the expected result is likely #t, this is faster than using -'commit-relation' since fewer commits need to be traversed." - (let ((old (list->setq old))) - (let loop ((commits (list new)) - (visited (setq))) - (match commits - (() - #f) - (_ - ;; Perform a breadth-first search as this is likely going to - ;; terminate more quickly than a depth-first search. - (let ((commits (remove (cut set-contains? visited <>) commits))) - (or (any (cut set-contains? old <>) commits) - (loop (append-map commit-parents commits) - (fold set-insert visited commits))))))))) +(define commit-descendant? + (if (resolve-module '(guix graph) #:ensure #f) ;Guile-Git >= 0.10.0 + (lambda (new old) + "Return true if NEW is the descendant of one of OLD, a list of +commits." + (let ((repository (commit-owner new)) + (new (commit-id new))) + (any (lambda (old) + (let ((old (commit-id old))) + (or (graph-descendant? repository new old) + (oid=? old new)))) + old))) + (lambda (new old) ;remove when Guile-Git 0.10.0 is widespread + (let ((old (list->setq old))) + (let loop ((commits (list new)) + (visited (setq))) + (match commits + (() + #f) + (_ + ;; Perform a breadth-first search as this is likely going to + ;; terminate more quickly than a depth-first search. + (let ((commits (remove (cut set-contains? visited <>) commits))) + (or (any (cut set-contains? old <>) commits) + (loop (append-map commit-parents commits) + (fold set-insert visited commits))))))))))) ;; -- 2.49.0 From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH 2/2] git: Remove compatibility shim for Guile-Git <= 0.5.2. 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 17 Apr 2025 20:24:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77875@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77875-submit@debbugs.gnu.org id=B77875.174492140126080 (code B ref 77875); Thu, 17 Apr 2025 20:24:09 +0000 Received: (at 77875) by debbugs.gnu.org; 17 Apr 2025 20:23:21 +0000 Received: from localhost ([127.0.0.1]:48585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5VlX-0006mH-89 for submit@debbugs.gnu.org; Thu, 17 Apr 2025 16:23:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44654) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5Vl9-0006gt-DI for 77875@debbugs.gnu.org; Thu, 17 Apr 2025 16:22:57 -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 1u5Vl3-0001An-Uj; Thu, 17 Apr 2025 16:22:49 -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=1dgNqeEFwGOQbVUuE9XtUV+y0sZdu6MBJiYCFTcvwmE=; b=b/QC2mcTZzZM96wwyEnX 9k/akof+IbNfq1KBqGWLmxlj76oARRzU8Jx0RInQUKSr+6iqMKsp/44JbRna0TvVhKu4jCFjFcxjq VQr8AFdhEzkii7+G19mxk9V1N8CQZmiTb0VYrxt/UUMyhZeUgLK3Y5ZksmSBiuR5d70KKjvXy71+O +ADXjNAYq5iplElvCvZEhxguXfcfHjAdiAxOj0ToWhOZW1IoAfYetCXKwzxwMV980VA83Zbnm+J+3 AlK6ForvnOyPqHQr1cHGMgutMu7Z3qpOoqn5PJRfMiG53GyAPac9f2gMPLHhN9QY8F6DTmPuV+3kN x4PFf+S+fdZ+Gw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 17 Apr 2025 22:22:37 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Guile-Git 0.5.2 was released in July 2021. * guix/git.scm (GITERR_HTTP): Remove. Change-Id: I05b2ee36f786bd83ca91c8989912f83f6dde59c0 --- guix/git.scm | 7 ------- 1 file changed, 7 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index cb26714d2d..2ff2bfd8ed 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -206,13 +206,6 @@ (define* (make-default-fetch-options #:key (verify-certificate? #t)) warn-for-invalid-certificate))) options)) -(define GITERR_HTTP - ;; Guile-Git <= 0.5.2 lacks this constant. - (let ((errors (resolve-interface '(git errors)))) - (if (module-defined? errors 'GITERR_HTTP) - (module-ref errors 'GITERR_HTTP) - 34))) - (define (set-git-timeouts connection-timeout read-timeout) "Instruct Guile-Git to honor the given CONNECTION-TIMEOUT and READ-TIMEOUT when talking to remote Git servers. -- 2.49.0 From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH 1/2] git: Use =?UTF-8?Q?=E2=80=98graph-descendant=3F=E2=80=99?= from Guile-Git >= 0.10.0 when available. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 21 Apr 2025 11:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 77875@debbugs.gnu.org Received: via spool by 77875-submit@debbugs.gnu.org id=B77875.17452343972984 (code B ref 77875); Mon, 21 Apr 2025 11:20:02 +0000 Received: (at 77875) by debbugs.gnu.org; 21 Apr 2025 11:19:57 +0000 Received: from localhost ([127.0.0.1]:60954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6pBo-0000lu-Lm for submit@debbugs.gnu.org; Mon, 21 Apr 2025 07:19:57 -0400 Received: from wolfsden.cz ([37.205.8.62]:44788) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1u6pBk-0000le-Us for 77875@debbugs.gnu.org; Mon, 21 Apr 2025 07:19:50 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id CB58139D8BF; Mon, 21 Apr 2025 11:19:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1745234387; bh=L5oJUp8AkP22Thn95k3p6l4vlTVzAUbd96rzs/qRdW0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=CqdIjBdKmDZBneHBpKFB7GOz6k3IZNct9FfgcPYAGNZAge/JMYOFeTvIBpGZ3XE3D rmsQ1lFofDJoQZ6i3oz23OddDnaHnejCSC06Ie1ZXlCNbK3TD8fRtwcgniZaQhds/2 t58qRrGv29Q51XZVsF6EWQ+woGvuCi2qJJ2E6lnqkP96PZRHCMynUE3xtdRZanzpxD Cso28ls0GRbJ6ASrISFEV6nK6S88vvGrLvBZ7J5eigm1bgI47q+RRALe3VzFPnutUQ VQgta5MOlyhFncT7GsB9Z5ey5qRhJQA9ynMPyqAxNYCbyXberqjQRljRJzvCNoheLN YqLfE2L2bJsewYoV97lm3G1czbkENObpfZG5Kwrg3IMt/P2gclQMsogIcXNgCHpnGE PJYQdMVtePN6EEiv8dYXXZT3HJQUEX59c5Ms6KMcD+iZMxMEFPJze9Kye0VjjXR186 XPrhe269W+Ye/KFuCJXgu5xurN6whIzgNF2YuzkWwkgWvKvtkGdeUVOm84gigm5XWA i2+bDxV4YaPw2MH/m32J0JutOXAFyy0sYbRxJP/r3pQtNjv+vWtVm4y/SZZuMXiG5c dkeaUwjsQ9RUdUkwCojTiWEm4HiuvRlk7Q+9J2omuePo/XQ2bDotWwo2tIL6oybSRn nR0qJjwMgxPYdZSAqwPbWjHg= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from localhost (unknown [185.24.21.241]) by wolfsden.cz (Postfix) with ESMTPSA id 3CA1939C7FD; Mon, 21 Apr 2025 11:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1745234386; bh=L5oJUp8AkP22Thn95k3p6l4vlTVzAUbd96rzs/qRdW0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=LjMxLYMUqXVYbimqOMQu+ilqP5N6zkf3nWdBhRr/pctqlxgMy0pJUhH23WiLK7rHo jy/ZujZSCxa/zb4jT0KBmUU81b9f7P03KOw1fL8EBZ3YolPnevKOb3mnnENzy99FTp yTezvIdjvHmaAW2k7hEdZ3uuMzWDgOo/O+dN3Jnz0+a8x3IYWZNDiHQ2meSO8KkrN1 gC5M2T3VOvKrO5lkJQ7LWoypjXMQTTdnRDmsTqKWqlxHZLxam378s2tGXailCfTU4n Yo5iE++Uw53K+56fmssSJzSHFM6NU1AJQGuj8WvkLxs7cCuKiJErjipRjjg0+Z64Xq Q4CMPDCO0jO7kaSZyOEFHEh4H8ojJvPNe6ARIpDgPTR4uA7GNZQkGcvuYr/2P0YOo7 cj/B/K4eSK7wdkZRzENjxNDaLfP15U1s006Po9hxHCXW2CBvZTweEUEsCFJ1TjZGgX jChGk/6UgcWhiF6xcVc/1/SMLd+LBfaH4VrfK+MGppT+m3nvZZJAsaVSdJ+Lc06WMP vCAllgq/5SOgidNM7qYgPbJZRyiL/pQqIHGgcxpVZd97Pd1FwaZY8rXfVFtVBQU2jg uKBQjlJ2vkyJ9EiyZX68bMcN0+NZa11UHoSon2jnjlnj9IwepTLb27IwlnXRHBHuGR oAzDx6Ho2ZM8YNKYCZt1RhI8= From: Tomas Volf <~@wolfsden.cz> In-Reply-To: ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 17 Apr 2025 22:22:36 +0200") References: Date: Mon, 21 Apr 2025 13:19:45 +0200 Message-ID: <87fri192y6.fsf@wolfsden.cz> 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-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, few comments below. Ludovic Court=C3=A8s writes: > Fixes . > > Fixes a bug whereby =E2=80=98commit-relation=E2=80=99 and =E2=80=98commit= -descendant?=E2=80=99 would > provide an incorrect result when two distinct objects would > exist for the same commit, which can happen when the commit=E2=80=99s met= adata > is beyond 4 KiB, as of libgit2 1.8/1.9. Ooh, so this *used to work* in <1.8, interesting, I had no idea. :) > > This, in turn, would lead =E2=80=98guix pull=E2=80=99 & co. to wrongfully= report an > attempt to downgrade and pull to an unrelated commit. > > * guix/git.scm (commit-relation): When (guix graph) is available, > rewrite in terms of =E2=80=98graph-descendant?=E2=80=99. > (commit-descendant?): Likewise. > > Change-Id: Ie52b188a8dfa90c95a73387c3ab2fdd04d2bf3e9 > Reported-by: Tomas Volf <~@wolfsden.cz> > --- > guix/git.scm | 83 ++++++++++++++++++++++++++++++++-------------------- > 1 file changed, 52 insertions(+), 31 deletions(-) > > diff --git a/guix/git.scm b/guix/git.scm > index 01e0918588..cb26714d2d 100644 > --- a/guix/git.scm > +++ b/guix/git.scm > @@ -732,7 +732,7 @@ (define (print-git-error port key args default-printe= r) > ;;; Commit difference. > ;;; >=20=20 > -(define* (commit-closure commit #:optional (visited (setq))) > +(define* (commit-closure commit #:optional (visited (setq))) ;to remove > "Return the closure of COMMIT as a set. Skip commits contained in VIS= ITED, > a set, and adjoin VISITED to the result." > (let loop ((commits (list commit)) > @@ -768,39 +768,60 @@ (define* (commit-difference new old #:optional (exc= luded '())) > (cons head result) > (set-insert head visited))))))) >=20=20 > -(define (commit-relation old new) > - "Return a symbol denoting the relation between OLD and NEW, two commit > +(define commit-relation > + (if (resolve-module '(guix graph) #:ensure #f) ;Guile-Git >=3D 0.10.0 Two notes here: 1. Should this not be '(git graph)? 2. I thought that when you do `guix pull`, the new Guix is built against the packages in the newly pulled version. So everyone who pulls these changes, should also pull the guile-git 0.10.0 no? It should not be possible to end up in "new guix, old guile-git" situation. So I do not understand why you need both branches. > + (lambda (old new) > + "Return a symbol denoting the relation between OLD and NEW, two = commit > objects: 'ancestor (meaning that OLD is an ancestor of NEW), 'descendant= , or > 'unrelated, or 'self (OLD and NEW are the same commit)." > - (if (eq? old new) > - 'self > - (let ((newest (commit-closure new))) > - (if (set-contains? newest old) > - 'ancestor > - (let* ((seen (list->setq (commit-parents new))) > - (oldest (commit-closure old seen))) > - (if (set-contains? oldest new) > - 'descendant > - 'unrelated)))))) > + (let ((repository (commit-owner old)) > + (old (commit-id old)) > + (new (commit-id new))) > + (cond ((graph-descendant? repository new old) How is the `graph-descendant?' set? The `resolve-module' seems to check for availability of the module, but it does not import bindings from it. (At least that is what short experimentation in REPL suggests...) > + 'ancestor) > + ((oid=3D? old new) > + 'self) > + ((graph-descendant? repository old new) > + 'descendant) > + (else 'unrelated)))) > + (lambda (old new) ;remove when Guile-Git 0.10.0 is wide= spread > + (if (eq? old new) > + 'self > + (let ((newest (commit-closure new))) > + (if (set-contains? newest old) > + 'ancestor > + (let* ((seen (list->setq (commit-parents new))) > + (oldest (commit-closure old seen))) > + (if (set-contains? oldest new) > + 'descendant > + 'unrelated)))))))) >=20=20 > -(define (commit-descendant? new old) > - "Return true if NEW is the descendant of one of OLD, a list of commits. > - > -When the expected result is likely #t, this is faster than using > -'commit-relation' since fewer commits need to be traversed." > - (let ((old (list->setq old))) > - (let loop ((commits (list new)) > - (visited (setq))) > - (match commits > - (() > - #f) > - (_ > - ;; Perform a breadth-first search as this is likely going to > - ;; terminate more quickly than a depth-first search. > - (let ((commits (remove (cut set-contains? visited <>) commits))) > - (or (any (cut set-contains? old <>) commits) > - (loop (append-map commit-parents commits) > - (fold set-insert visited commits))))))))) > +(define commit-descendant? > + (if (resolve-module '(guix graph) #:ensure #f) ;Guile-Git >=3D 0.10.0 Same question regarding '(git graph) here. > + (lambda (new old) > + "Return true if NEW is the descendant of one of OLD, a list of > +commits." > + (let ((repository (commit-owner new)) > + (new (commit-id new))) > + (any (lambda (old) > + (let ((old (commit-id old))) > + (or (graph-descendant? repository new old) > + (oid=3D? old new)))) > + old))) I would be tempted to write this in terms of commit-relation and memq with '(self descendant). Beside being slightly easier to grasp (for me), it would allow you to have just a single branch, since commit-relation is available regardless of guile-git version. Not sure if there would be performance impact in <0.10.0 though. > + (lambda (new old) ;remove when Guile-Git 0.10.0 is wide= spread > + (let ((old (list->setq old))) > + (let loop ((commits (list new)) > + (visited (setq))) > + (match commits > + (() > + #f) > + (_ > + ;; Perform a breadth-first search as this is likely going= to > + ;; terminate more quickly than a depth-first search. > + (let ((commits (remove (cut set-contains? visited <>) com= mits))) > + (or (any (cut set-contains? old <>) commits) > + (loop (append-map commit-parents commits) > + (fold set-insert visited commits))))))))))) >=20=20 > > ;; Have a nice day, Tomas --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH v2 0/2] Use 'graph-descendant?' from Guile-Git instead of custom code References: In-Reply-To: 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 21 Apr 2025 21:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77875@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77875-submit@debbugs.gnu.org id=B77875.174527084832151 (code B ref 77875); Mon, 21 Apr 2025 21:28:02 +0000 Received: (at 77875) by debbugs.gnu.org; 21 Apr 2025 21:27:28 +0000 Received: from localhost ([127.0.0.1]:39775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6yfn-0008MV-N9 for submit@debbugs.gnu.org; Mon, 21 Apr 2025 17:27:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42110) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6yfl-0008M8-1F for 77875@debbugs.gnu.org; Mon, 21 Apr 2025 17:27:25 -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 1u6yff-00083M-Nt; Mon, 21 Apr 2025 17:27:19 -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:Subject:To:From:in-reply-to: references; bh=sVQ/VKjSGXWkmUYo6Z1Ilg1+dIQpaWCIRekDzkKYTgQ=; b=a+Ei2uJj8PUbOC 6nxvCTqsbwTOHMDuyXjIkp+LtFR5oOWrqBYADVoQsa/I2E0M47QlrH/TCuEoy4v6J3SvFGpqOILvs qA440FmtFaHu+P6TpbqlwuUDe/aroH3IYgf3Du6/JBsz2gd9BrmhrWof4YpP2DjM7FQkRiN5L4K78 oy9gZjQftZU9Ow7dzr+loh5hih5z32fecq1PBkDcgSuIUO4xSzpvykDNa8s34khZPv9w7IzPSkwTe Ee/R04ttnKdsA7zp5L67P8dKqaYTBxz0XoLotTnxf08nfe9Mbkq32pkbjHTsC/kk4LgODfES32LhK f9WMx8kbtnHHVwUSJjEg==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 21 Apr 2025 23:26:24 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Changes since v1: • Check for (git graph), not (guix graph), as noted by Tomas. • Improve wording in commit log. Ludovic Courtès (2): git: Use ‘graph-descendant?’ from Guile-Git >= 0.10.0 when available. git: Remove compatibility shim for Guile-Git <= 0.5.2. guix/git.scm | 90 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 38 deletions(-) base-commit: ba53ff9cc403c7f0388e2dc932cb46e665e81be7 -- 2.49.0 From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH v2 2/2] git: Remove compatibility shim for Guile-Git <= 0.5.2. 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 21 Apr 2025 21:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77875@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77875-submit@debbugs.gnu.org id=B77875.174527085332171 (code B ref 77875); Mon, 21 Apr 2025 21:28:03 +0000 Received: (at 77875) by debbugs.gnu.org; 21 Apr 2025 21:27:33 +0000 Received: from localhost ([127.0.0.1]:39777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6yft-0008Mo-4P for submit@debbugs.gnu.org; Mon, 21 Apr 2025 17:27:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39124) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6yfn-0008ME-8Y for 77875@debbugs.gnu.org; Mon, 21 Apr 2025 17:27:27 -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 1u6yfh-00083q-UV; Mon, 21 Apr 2025 17:27:21 -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=zLbndl+zgbKXNNuAUo474BSFo5hTo27aEYJMuhok16Y=; b=SH/s7KeyveBSjVa4/Wqt aoaClqcJrz/eu6X/A9MfxUYyjmp/JfHh7bkU3OjDCXylY3Bd2KN0PPBGT7izrbJ7IhAGHI/rO5Zp6 eSsJ3if88SzCGfmdNRUomUMm53J4QM83CGRCF+rgSQdpVu6UKVB+eyTATxJMTP8T9YeQ3PpWfFy1h q1v2KDGf/ah2JRUM7rkRHloLhpvGYRb4R4rpSpmQ0ngzYqaq4H/ELhVM6OSA1/vq6QmvnPwQr862B F2LmxchZcoGnnKW5UOmE6l6qSAdmO0LLLmyhG83vIlXLUgY4vj5wyvoAvLnTZFBycrPlNsDL26v0V UqcJy5tr64CXrQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 21 Apr 2025 23:26:26 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Guile-Git 0.5.2 was released in July 2021. * guix/git.scm (GITERR_HTTP): Remove. Change-Id: I05b2ee36f786bd83ca91c8989912f83f6dde59c0 --- guix/git.scm | 7 ------- 1 file changed, 7 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index 1065479091..da0a668587 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -206,13 +206,6 @@ (define* (make-default-fetch-options #:key (verify-certificate? #t)) warn-for-invalid-certificate))) options)) -(define GITERR_HTTP - ;; Guile-Git <= 0.5.2 lacks this constant. - (let ((errors (resolve-interface '(git errors)))) - (if (module-defined? errors 'GITERR_HTTP) - (module-ref errors 'GITERR_HTTP) - 34))) - (define (set-git-timeouts connection-timeout read-timeout) "Instruct Guile-Git to honor the given CONNECTION-TIMEOUT and READ-TIMEOUT when talking to remote Git servers. -- 2.49.0 From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH v2 1/2] git: Use =?UTF-8?Q?=E2=80=98graph-descendant=3F=E2=80=99?= from Guile-Git >= 0.10.0 when available. 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 21 Apr 2025 21:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77875@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tomas Volf <~@wolfsden.cz>, Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77875-submit@debbugs.gnu.org id=B77875.174527085432178 (code B ref 77875); Mon, 21 Apr 2025 21:28:03 +0000 Received: (at 77875) by debbugs.gnu.org; 21 Apr 2025 21:27:34 +0000 Received: from localhost ([127.0.0.1]:39779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6yft-0008Mq-Dw for submit@debbugs.gnu.org; Mon, 21 Apr 2025 17:27:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39114) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6yfn-0008MD-0h for 77875@debbugs.gnu.org; Mon, 21 Apr 2025 17:27:28 -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 1u6yfg-00083d-U0; Mon, 21 Apr 2025 17:27:20 -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=Id+zu/98wbfjOFmozoYQPcqn3B0jIfJ+hiY/+GoDtZI=; b=WJ/Dt95vvE/sElFbzfoQ 3NhnjPtQyOehTuP/5Abxv8es8vJO0mMNj/QUW1ciKXN4MBvYIeHOXGDyaYwXlmihAjyKefQJpA73V ASHY0dBAaU9WUFsCMBVo0AG0HlBE6WQb9DVJFpsU6O2RdCLLnpHN9kDwCMT7zifXL3Mc4mpKPH2H4 zjWJvm+BulwNePscLyrdbQLRiPU/GLqY2N58v7uZGywf1E+LmIVJfZUWhq5ntrEI1g7YSB57fSv02 1uXXuyl9J8eKMAryHYIr4giBHqCpu8cJN8i+J6cUhKMg3a4eogdTOA3nbPGlURFPHvZQ4MFXS/pgR CU2+EDDZZL+Kpg==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 21 Apr 2025 23:26:25 +0200 Message-ID: <2d335f155de9f667b08393a4e9e8ffa41e03d201.1745270691.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Fixes . Fixes a bug whereby ‘commit-relation’ and ‘commit-descendant?’ would provide an incorrect result when two distinct objects would exist for the same commit, which happens when the commit’s metadata is beyond 4 KiB at least as of libgit2 1.8/1.9. This, in turn, would lead ‘guix pull’ & co. to wrongfully report an attempt to downgrade and pull to an unrelated commit. * guix/git.scm (commit-relation): When (guix graph) is available, rewrite in terms of ‘graph-descendant?’. (commit-descendant?): Likewise. Change-Id: Ie52b188a8dfa90c95a73387c3ab2fdd04d2bf3e9 Reported-by: Tomas Volf <~@wolfsden.cz> --- guix/git.scm | 83 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 31 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index 01e0918588..1065479091 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -732,7 +732,7 @@ (define (print-git-error port key args default-printer) ;;; Commit difference. ;;; -(define* (commit-closure commit #:optional (visited (setq))) +(define* (commit-closure commit #:optional (visited (setq))) ;to remove "Return the closure of COMMIT as a set. Skip commits contained in VISITED, a set, and adjoin VISITED to the result." (let loop ((commits (list commit)) @@ -768,39 +768,60 @@ (define* (commit-difference new old #:optional (excluded '())) (cons head result) (set-insert head visited))))))) -(define (commit-relation old new) - "Return a symbol denoting the relation between OLD and NEW, two commit +(define commit-relation + (if (resolve-module '(git graph) #:ensure #f) ;Guile-Git >= 0.10.0 + (lambda (old new) + "Return a symbol denoting the relation between OLD and NEW, two commit objects: 'ancestor (meaning that OLD is an ancestor of NEW), 'descendant, or 'unrelated, or 'self (OLD and NEW are the same commit)." - (if (eq? old new) - 'self - (let ((newest (commit-closure new))) - (if (set-contains? newest old) - 'ancestor - (let* ((seen (list->setq (commit-parents new))) - (oldest (commit-closure old seen))) - (if (set-contains? oldest new) - 'descendant - 'unrelated)))))) + (let ((repository (commit-owner old)) + (old (commit-id old)) + (new (commit-id new))) + (cond ((graph-descendant? repository new old) + 'ancestor) + ((oid=? old new) + 'self) + ((graph-descendant? repository old new) + 'descendant) + (else 'unrelated)))) + (lambda (old new) ;remove when Guile-Git 0.10.0 is widespread + (if (eq? old new) + 'self + (let ((newest (commit-closure new))) + (if (set-contains? newest old) + 'ancestor + (let* ((seen (list->setq (commit-parents new))) + (oldest (commit-closure old seen))) + (if (set-contains? oldest new) + 'descendant + 'unrelated)))))))) -(define (commit-descendant? new old) - "Return true if NEW is the descendant of one of OLD, a list of commits. - -When the expected result is likely #t, this is faster than using -'commit-relation' since fewer commits need to be traversed." - (let ((old (list->setq old))) - (let loop ((commits (list new)) - (visited (setq))) - (match commits - (() - #f) - (_ - ;; Perform a breadth-first search as this is likely going to - ;; terminate more quickly than a depth-first search. - (let ((commits (remove (cut set-contains? visited <>) commits))) - (or (any (cut set-contains? old <>) commits) - (loop (append-map commit-parents commits) - (fold set-insert visited commits))))))))) +(define commit-descendant? + (if (resolve-module '(git graph) #:ensure #f) ;Guile-Git >= 0.10.0 + (lambda (new old) + "Return true if NEW is the descendant of one of OLD, a list of +commits." + (let ((repository (commit-owner new)) + (new (commit-id new))) + (any (lambda (old) + (let ((old (commit-id old))) + (or (graph-descendant? repository new old) + (oid=? old new)))) + old))) + (lambda (new old) ;remove when Guile-Git 0.10.0 is widespread + (let ((old (list->setq old))) + (let loop ((commits (list new)) + (visited (setq))) + (match commits + (() + #f) + (_ + ;; Perform a breadth-first search as this is likely going to + ;; terminate more quickly than a depth-first search. + (let ((commits (remove (cut set-contains? visited <>) commits))) + (or (any (cut set-contains? old <>) commits) + (loop (append-map commit-parents commits) + (fold set-insert visited commits))))))))))) ;; -- 2.49.0 From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH 1/2] git: Use =?UTF-8?Q?=E2=80=98graph-descendant=3F=E2=80=99?= from Guile-Git >= 0.10.0 when available. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 21 Apr 2025 21:29:11 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tomas Volf <~@wolfsden.cz> Cc: 77875@debbugs.gnu.org Received: via spool by 77875-submit@debbugs.gnu.org id=B77875.174527090332452 (code B ref 77875); Mon, 21 Apr 2025 21:29:11 +0000 Received: (at 77875) by debbugs.gnu.org; 21 Apr 2025 21:28:23 +0000 Received: from localhost ([127.0.0.1]:39812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6ygg-0008RL-Kg for submit@debbugs.gnu.org; Mon, 21 Apr 2025 17:28:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54602) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6ygd-0008R6-NN for 77875@debbugs.gnu.org; Mon, 21 Apr 2025 17:28:20 -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 1u6ygY-0008Bo-7d; Mon, 21 Apr 2025 17:28:14 -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=Af1GjaiJ3FWCSeiy3rDY69Hl4lMuZ62Fv/ZI2zEKVQc=; b=HZCoEMLeWoKlEKXvYYNr wfBuwMXThU8mJ2fIg4S/89hxRO7Hn59eWvVV6CuILHB8sSEY/dvyMdo4XBYumaXxkXH7XvBYPuwyC wwkiAfe/1Cc2YdwWskHQGMW0Rti6bBkLd4hqsYaKxnPY9xKSN/81XO6Enq+5OtIV8dWxJH7D73Hyg olG0UNruM1nUFtnUXxClLOEQFmrKzX1ROmy9C28JW0Ped7KOmUBwoiZS/0cg/QnbUOjWcCYd83Gqq z3+IGSTuSGmwj+UTfg7gKi/H526oc5S51QXKMrC53oQ5RdpXpjuvhs9CUjA20oTgKbraM7LAp3eWF wJgnCd/ANp96og==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <87fri192y6.fsf@wolfsden.cz> (Tomas Volf's message of "Mon, 21 Apr 2025 13:19:45 +0200") References: <87fri192y6.fsf@wolfsden.cz> User-Agent: mu4e 1.12.9; emacs 29.4 X-URL: https://people.bordeaux.inria.fr/lcourtes/ X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-Revolutionary-Date: Duodi 2 =?UTF-8?Q?Flor=C3=A9al?= an 233 de la =?UTF-8?Q?R=C3=A9volution,?= jour du =?UTF-8?Q?Ch=C3=AAne?= Date: Mon, 21 Apr 2025 23:26:56 +0200 Message-ID: <87ecxl434v.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Tomas, Tomas Volf <~@wolfsden.cz> writes: > Ludovic Court=C3=A8s writes: > >> Fixes . >> >> Fixes a bug whereby =E2=80=98commit-relation=E2=80=99 and =E2=80=98commi= t-descendant?=E2=80=99 would >> provide an incorrect result when two distinct objects would >> exist for the same commit, which can happen when the commit=E2=80=99s me= tadata >> is beyond 4 KiB, as of libgit2 1.8/1.9. > > Ooh, so this *used to work* in <1.8, interesting, I had no idea. :) No no; what I meant is that this is known to be the case with 1.8 and 1.9, but I haven't checked with other versions. >> + (if (resolve-module '(guix graph) #:ensure #f) ;Guile-Git >=3D 0.10.0 > > Two notes here: > > 1. Should this not be '(git graph)? Oops, yes! Fixed locally. > 2. I thought that when you do `guix pull`, the new Guix is built against > the packages in the newly pulled version. So everyone who pulls these > changes, should also pull the guile-git 0.10.0 no? It should not be > possible to end up in "new guix, old guile-git" situation. So I do not > understand why you need both branches. That's correct. The second branch is a convenience for developers as I wrote, typically for someone developing in =E2=80=9Cguix shell=E2=80=9D but= from a Guix that doesn=E2=80=99t have 0.10.0 yet. We can remove that second branch in = a few weeks. > How is the `graph-descendant?' set? It=E2=80=99s from the (git) module, automatically pulled in when available. >> + (lambda (new old) >> + "Return true if NEW is the descendant of one of OLD, a list of >> +commits." >> + (let ((repository (commit-owner new)) >> + (new (commit-id new))) >> + (any (lambda (old) >> + (let ((old (commit-id old))) >> + (or (graph-descendant? repository new old) >> + (oid=3D? old new)))) >> + old))) > > I would be tempted to write this in terms of commit-relation and memq > with '(self descendant). Beside being slightly easier to grasp (for > me), it would allow you to have just a single branch, since > commit-relation is available regardless of guile-git version. Not sure > if there would be performance impact in <0.10.0 though. I thought about this but I think the implementation above is slightly more efficient, and since the "else" branch will be removed soon, let's not bother. Sending v2 right away. Thanks, Ludo'. From unknown Fri Aug 15 14:45:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#77875] [PATCH v2 1/2] git: Use =?UTF-8?Q?=E2=80=98graph-descendant=3F=E2=80=99?= from Guile-Git >= 0.10.0 when available. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 22 Apr 2025 16:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77875 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 77875@debbugs.gnu.org Received: via spool by 77875-submit@debbugs.gnu.org id=B77875.174534072319507 (code B ref 77875); Tue, 22 Apr 2025 16:53:02 +0000 Received: (at 77875) by debbugs.gnu.org; 22 Apr 2025 16:52:03 +0000 Received: from localhost ([127.0.0.1]:49659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7Gqp-00054Z-0m for submit@debbugs.gnu.org; Tue, 22 Apr 2025 12:52:03 -0400 Received: from wolfsden.cz ([37.205.8.62]:42170) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1u7Gqj-000542-Su for 77875@debbugs.gnu.org; Tue, 22 Apr 2025 12:52:00 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id 0E1BE3A4C2A; Tue, 22 Apr 2025 16:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1745340716; bh=OmtdwfwfeHWi0ePDcPQI1gJZcuZLOlFTZ9c5wnz8uDc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GT7omwNVjdBvjw0K0/gceQbxs+lDLCfZn6nZobVoIa6gwLJSThHhZ5V0cvWDu7kNr CRpxum6aht5o4JOXvXUYVJRfDd/M8mvep+CGKpTINBR0Mme4VdeHBGXFiEazvFS+cs NTX/UlwXCNJNqGlWduQd2GSHDl0V0w4j4Nq3PAaq8i/kf4mWEg4p8iB6MiuUb375FQ LpkVYgsEKeHIgy5eZm3PAIb0hm1ZqjOp0WZRPslJchOLAcij0R0BSImkpMjf1DytNp 8Za5NBaRYHhpp6BT9qACH5MgTfI6h82xCENiBffOMIOMLoD5M4JCx1BfmSXm0UrTy/ rpH+KzSbEaJlPhm/7uFUEySRjLu+sZv4arSfzcf1zXofNXA9P8kNt0ikdXRsimKwQM Mbo3ldJBfJMVKwbyjSSBJU9HhNFbCE0I8nAfdOX34s9+hspzw5Eokhf6LEqt4Bgv2P 27XRda64zMCS4apl0H04SF75YiOplp1wiHrmvtCbpViNiG58svr0EEvaBOFthZrLUq J64iFvygJiTne2QW4SW1UuV0QWlo85TSnF/MiMfO5qqmLQbFX0gqu4mY1lgj7CXNNd w5hw+sAu9g0es4YHywxGgyV3PXPRFsb2TgSPMgAttIqcRLhxza6NZlfVMXGcxJBtMF pBevvDOIf20UHu5B+CqTnL2Q= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (89-24-35-10.nat.epc.tmcz.cz [89.24.35.10]) by wolfsden.cz (Postfix) with ESMTPSA id 286553A5999; Tue, 22 Apr 2025 16:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1745340715; bh=OmtdwfwfeHWi0ePDcPQI1gJZcuZLOlFTZ9c5wnz8uDc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=T5+Big6n/CvH0vqVezS4mQfA7cRMjjR/8m0utPn29X90NrNhAA0vqrC50pJzvVUU7 e0V68QfqZ7qbAt5BLcKg82cvumhA1T0pAIiYkAxP1NKD1+jx5ux0EW0kC3p8Dwn8hk mKUBTSXtPqIW02H8uo+ksTjyGMCn1ErfM/UId8QM8mxIDTh8ewP3oSV1HoNBsKEDFf 9bfsk/HEoS8TPylBjLi1qb2LjwCHCF9ue4HivnDbF78MEj+Di40ciIPq3WO0y8dFXE eWCO2NJ2WS5Wn6A/gWXw26jvDdkij0oEkeLDcFiAg1hAOTMTwfSP2Z5kVwihKvGrgK ZymCdMxjkNcR8W5uklZXLWyqrD/aLuOH9cp6AAX81qcHrH9VBg0l2Exj0d+TYHec6N orZT/E+TnavbXTnifS2IckyKNmqdI96h217wuznGJJ0tiSu/x2cwD024STjbOLaOO5 P4NSCAJ8cr/q0myv5TvJEfFdBCMrQ4AcWKVNaCrR/SvvWMOHeC+GlkF71odJFmXAod V/YwEmJWlULI8PUkuv4jDKZqBzjTHcn+xikv733GfcI0bMO6WHXQUHHHk6ImHYxRmD G/fVIuFxuHTc/3lHD4RXnIA38moz0LcS9pVAIk980ca9cH1a8tEGQXUMcOO/MqUEgg H1UR7j1vgYPumQS9uzgBFf00= From: Tomas Volf <~@wolfsden.cz> In-Reply-To: <2d335f155de9f667b08393a4e9e8ffa41e03d201.1745270691.git.ludo@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 21 Apr 2025 23:26:25 +0200") References: <2d335f155de9f667b08393a4e9e8ffa41e03d201.1745270691.git.ludo@gnu.org> Date: Tue, 22 Apr 2025 18:51:54 +0200 Message-ID: <871ptkcf6d.fsf@wolfsden.cz> 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-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ludovic Court=C3=A8s writes: > Fixes . > > Fixes a bug whereby =E2=80=98commit-relation=E2=80=99 and =E2=80=98commit= -descendant?=E2=80=99 would > provide an incorrect result when two distinct objects would > exist for the same commit, which happens when the commit=E2=80=99s metada= ta is > beyond 4 KiB at least as of libgit2 1.8/1.9. > > This, in turn, would lead =E2=80=98guix pull=E2=80=99 & co. to wrongfully= report an > attempt to downgrade and pull to an unrelated commit. > > * guix/git.scm (commit-relation): When (guix graph) is available, You forgot to switch to (git graph) here. > rewrite in terms of =E2=80=98graph-descendant?=E2=80=99. > (commit-descendant?): Likewise. > > Change-Id: Ie52b188a8dfa90c95a73387c3ab2fdd04d2bf3e9 > Reported-by: Tomas Volf <~@wolfsden.cz> > --- > guix/git.scm | 83 ++++++++++++++++++++++++++++++++-------------------- > 1 file changed, 52 insertions(+), 31 deletions(-) > > diff --git a/guix/git.scm b/guix/git.scm > index 01e0918588..1065479091 100644 > --- a/guix/git.scm > +++ b/guix/git.scm > @@ -732,7 +732,7 @@ (define (print-git-error port key args default-printe= r) > ;;; Commit difference. > ;;; >=20=20 > -(define* (commit-closure commit #:optional (visited (setq))) > +(define* (commit-closure commit #:optional (visited (setq))) ;to remove > "Return the closure of COMMIT as a set. Skip commits contained in VIS= ITED, > a set, and adjoin VISITED to the result." > (let loop ((commits (list commit)) > @@ -768,39 +768,60 @@ (define* (commit-difference new old #:optional (exc= luded '())) > (cons head result) > (set-insert head visited))))))) >=20=20 > -(define (commit-relation old new) > - "Return a symbol denoting the relation between OLD and NEW, two commit > +(define commit-relation > + (if (resolve-module '(git graph) #:ensure #f) ;Guile-Git >=3D 0.10.0 > + (lambda (old new) > + "Return a symbol denoting the relation between OLD and NEW, two = commit > objects: 'ancestor (meaning that OLD is an ancestor of NEW), 'descendant= , or > 'unrelated, or 'self (OLD and NEW are the same commit)." > - (if (eq? old new) > - 'self > - (let ((newest (commit-closure new))) > - (if (set-contains? newest old) > - 'ancestor > - (let* ((seen (list->setq (commit-parents new))) > - (oldest (commit-closure old seen))) > - (if (set-contains? oldest new) > - 'descendant > - 'unrelated)))))) > + (let ((repository (commit-owner old)) > + (old (commit-id old)) > + (new (commit-id new))) > + (cond ((graph-descendant? repository new old) > + 'ancestor) > + ((oid=3D? old new) > + 'self) > + ((graph-descendant? repository old new) > + 'descendant) > + (else 'unrelated)))) > + (lambda (old new) ;remove when Guile-Git 0.10.0 is wide= spread > + (if (eq? old new) > + 'self > + (let ((newest (commit-closure new))) > + (if (set-contains? newest old) > + 'ancestor > + (let* ((seen (list->setq (commit-parents new))) > + (oldest (commit-closure old seen))) > + (if (set-contains? oldest new) > + 'descendant > + 'unrelated)))))))) >=20=20 > -(define (commit-descendant? new old) > - "Return true if NEW is the descendant of one of OLD, a list of commits. > - > -When the expected result is likely #t, this is faster than using > -'commit-relation' since fewer commits need to be traversed." > - (let ((old (list->setq old))) > - (let loop ((commits (list new)) > - (visited (setq))) > - (match commits > - (() > - #f) > - (_ > - ;; Perform a breadth-first search as this is likely going to > - ;; terminate more quickly than a depth-first search. > - (let ((commits (remove (cut set-contains? visited <>) commits))) > - (or (any (cut set-contains? old <>) commits) > - (loop (append-map commit-parents commits) > - (fold set-insert visited commits))))))))) > +(define commit-descendant? > + (if (resolve-module '(git graph) #:ensure #f) ;Guile-Git >=3D 0.10.0 > + (lambda (new old) > + "Return true if NEW is the descendant of one of OLD, a list of > +commits." > + (let ((repository (commit-owner new)) > + (new (commit-id new))) > + (any (lambda (old) > + (let ((old (commit-id old))) > + (or (graph-descendant? repository new old) > + (oid=3D? old new)))) > + old))) > + (lambda (new old) ;remove when Guile-Git 0.10.0 is wide= spread > + (let ((old (list->setq old))) > + (let loop ((commits (list new)) > + (visited (setq))) > + (match commits > + (() > + #f) > + (_ > + ;; Perform a breadth-first search as this is likely going= to > + ;; terminate more quickly than a depth-first search. > + (let ((commits (remove (cut set-contains? visited <>) com= mits))) > + (or (any (cut set-contains? old <>) commits) > + (loop (append-map commit-parents commits) > + (fold set-insert visited commits))))))))))) >=20=20 > > ;; Other then the commit message looks good. Reviewed-by: Tomas Volf <~@wolfsden.cz> --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. From unknown Fri Aug 15 14:45:21 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#77875: closed (Re: [PATCH v2 1/2] git: Use =?UTF-8?Q?=E2=80=98graph-descendant=3F=E2=80=99?= from Guile-Git >= 0.10.0 when available.) Message-ID: References: <87frhznp9b.fsf@gnu.org> X-Gnu-PR-Message: they-closed 77875 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 77875@debbugs.gnu.org Date: Wed, 23 Apr 2025 10:33:16 +0000 Content-Type: multipart/mixed; boundary="----------=_1745404396-8177-1" This is a multi-part message in MIME format... ------------=_1745404396-8177-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #77875: [PATCH 0/2] Use 'graph-descendant?' from Guile-Git instead of custo= m code which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 77875@debbugs.gnu.org. --=20 77875: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D77875 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1745404396-8177-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 77875-done) by debbugs.gnu.org; 23 Apr 2025 10:32:46 +0000 Received: from localhost ([127.0.0.1]:54186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7XPI-000233-8g for submit@debbugs.gnu.org; Wed, 23 Apr 2025 06:32:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50460) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u7XP8-00020K-Eq for 77875-done@debbugs.gnu.org; Wed, 23 Apr 2025 06:32:36 -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 1u7XP3-0005YA-1L; Wed, 23 Apr 2025 06:32:29 -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=XiLD6nZqcixYqS00FCJq8OuKsNwFErs5Yh2BO4DW/D0=; b=hNzBDnhyStqhFEOp/S/e WCremlwiA1NrXxo6uEGO2IQ2xxG/WH/0aZc7sgQGrx5gaGSUeMcdiar+S9jujmcZ+1CZNlwH7mtxs l4MOG7n60kh8pcC4s39JEX29TGSK2kxntkzkF+bwWMwHdAPljhZOSt7vBF3WZQHELkq8DCaeeaCVX VGe7Xxt+fv9msLyG5GNlExErsX7mxZML7D/4E2GyC0lbF4fxjKHANdKz1zROndXyqbLIubAjDRWK2 7TDlnLm3SgCgjH1lxmXgODc0+flMdHveTTxmo7DI1gqkiIv2zzcNTIAo7q4Ftbl3fxH79V6FfhSq/ I/u4dQ0DF2GBQw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Tomas Volf <~@wolfsden.cz> Subject: Re: [PATCH v2 1/2] git: Use =?utf-8?Q?=E2=80=98graph-descendant?= =?utf-8?Q?=3F=E2=80=99?= from Guile-Git >= 0.10.0 when available. In-Reply-To: <871ptkcf6d.fsf@wolfsden.cz> (Tomas Volf's message of "Tue, 22 Apr 2025 18:51:54 +0200") References: <2d335f155de9f667b08393a4e9e8ffa41e03d201.1745270691.git.ludo@gnu.org> <871ptkcf6d.fsf@wolfsden.cz> User-Agent: mu4e 1.12.9; emacs 29.4 X-URL: https://people.bordeaux.inria.fr/lcourtes/ X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-Revolutionary-Date: Quartidi 4 =?utf-8?Q?Flor=C3=A9al?= an 233 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de =?utf-8?Q?l'Aub=C3=A9pine?= Date: Wed, 23 Apr 2025 12:30:56 +0200 Message-ID: <87frhznp9b.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77875-done Cc: 77875-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Tomas Volf <~@wolfsden.cz> writes: > Ludovic Court=C3=A8s writes: > >> Fixes . >> >> Fixes a bug whereby =E2=80=98commit-relation=E2=80=99 and =E2=80=98commi= t-descendant?=E2=80=99 would >> provide an incorrect result when two distinct objects would >> exist for the same commit, which happens when the commit=E2=80=99s metad= ata is >> beyond 4 KiB at least as of libgit2 1.8/1.9. >> >> This, in turn, would lead =E2=80=98guix pull=E2=80=99 & co. to wrongfull= y report an >> attempt to downgrade and pull to an unrelated commit. >> >> * guix/git.scm (commit-relation): When (guix graph) is available, > > You forgot to switch to (git graph) here. Oops. Fixed and pushed as ee6d2a77a3f07c4b81fd31bc7aa5d07accc317bd. Thanks, Ludo=E2=80=99. ------------=_1745404396-8177-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Apr 2025 20:20:37 +0000 Received: from localhost ([127.0.0.1]:48566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5Viv-0006JQ-0m for submit@debbugs.gnu.org; Thu, 17 Apr 2025 16:20:37 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49518) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5Vip-0006Ha-08 for submit@debbugs.gnu.org; Thu, 17 Apr 2025 16:20:34 -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 1u5Vic-0005fZ-Ii for guix-patches@gnu.org; Thu, 17 Apr 2025 16:20:24 -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 1u5ViZ-0000bB-67; Thu, 17 Apr 2025 16:20:16 -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:Subject:To:From:in-reply-to: references; bh=dG+m/YzPYlKGgbqTnFfMXWVM4r0gWRNR3YXE+eeh/Z0=; b=P/Yn1/D/2K4O41 Y5YBGI/YpTS6CDJINajpBLl6zgJ+s6PQoRwSLcoB6OwuuGAQLD8ZXGNx5+IyZE7W211u8E4biOi42 PuWBoPlQcbPCnnYnrgKh3POTytoY5Slnz3EzmPFDfXXR4e2h8QM2Zm1q9mRoZ/efiVDzQmmAikuLz KIf1M3JSyThBdUCSVWbznmS/L7MzwEW51oFfSLFBEDOHfWHnKQykehi3ZZrxOZS11DaiKxQEeFdBR VOs286DXVAiSuKxyK4OEacnU/W+W6Ofh1a2DNkX/DdSTPuikuK74yLgJ/SCEoRcvqbxucVmEjRM7k DtZfjdQa6GYlIdhXeu7g==; From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/2] Use 'graph-descendant?' from Guile-Git instead of custom code Date: Thu, 17 Apr 2025 22:19:58 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= , Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, This is a bug fix and potentially a performance improvement (I didn’t attempt to benchmark it but if someone wants to do it, I’m curious!). Note that the existing code is kept around for now. We can remove it in a couple of months when Guile-Git 0.10.0 is considered widespread enough. This is a convenience for developers since in practice Guix itself will have switched to Guile-Git 0.10.0 within a few hours. Thanks, Ludo’. Ludovic Courtès (2): git: Use ‘graph-descendant?’ from Guile-Git >= 0.10.0 when available. git: Remove compatibility shim for Guile-Git <= 0.5.2. guix/git.scm | 90 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 38 deletions(-) base-commit: 4bd2949cfa7a8bf5dfe66adad1a76472af09708d -- 2.49.0 ------------=_1745404396-8177-1--