GNU bug report logs - #78432
[PATCH 1/2] channels: Speed up ‘channel-news-for-commit’.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Ludovic Courtès <ludo@HIDDEN>; Keywords: patch; Done: Ludovic Courtès <ludo@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 78432-done <at> debbugs.gnu.org:


Received: (at 78432-done) by debbugs.gnu.org; 18 May 2025 21:04:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 18 17:04:53 2025
Received: from localhost ([127.0.0.1]:60989 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uGlBk-0007fe-Jz
	for submit <at> debbugs.gnu.org; Sun, 18 May 2025 17:04:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53190)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1uGlAN-0007a3-Lr
 for 78432-done <at> debbugs.gnu.org; Sun, 18 May 2025 17:03: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 <ludo@HIDDEN>)
 id 1uGlAI-0002Lc-02; Sun, 18 May 2025 17:03:22 -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=FIudH9iUAY2C6879txMMIhobUfIP3CWf7/POWLFXXXM=; b=cpsiHgv8TK8BYnFxANVB
 Lo4AiruWZ+mGaWbWX2XNAwWDWuqO8cmEFyCF4y3yXSBkSs0/o/Q9PRXNVBbbysS+MDWb5J3bOnNqp
 JR92U6EkVQm42dQTwhrm7V+qAj7V7jyYqduRqRZMMVfnlsBUn+KY37dAfUpk8kptOroVeUf9oPxqm
 gozbm1jsViVs+zpzk8DZvhNeP7mf+Gai1NO6KQhnOnBX76qN5kol3VmJJqEEx5pFq9C7mccV1F4wK
 TCraSd1QFM1e4WZ5YW6WypdS6kqbtr2hjFeMwSw6++X9G3xUjeobA5sF74IqYBLKzepo3Ipp7E2lf
 DGdw5YexCttFMw==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Ian Eure <ian@HIDDEN>
Subject: Re: [bug#78432] [PATCH 2/2] git: Remove code for Guile-Git < 0.10.0.
In-Reply-To: <875xhzfabk.fsf@HIDDEN> (Ian Eure's message of "Sat, 17 May
 2025 09:53:19 -0700")
References: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@HIDDEN>
 <875xhzfabk.fsf@HIDDEN>
Date: Sun, 18 May 2025 23:02:08 +0200
Message-ID: <87v7pxk4z3.fsf@HIDDEN>
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: -2.3 (--)
X-Debbugs-Envelope-To: 78432-done
Cc: Josselin Poiret <dev@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>, 78432-done <at> debbugs.gnu.org,
 Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Ian Eure <ian@HIDDEN> writes:

> Both patches LGTM!

Thanks for taking a look.  Pushed:

  86022e994e * git: Remove code for Guile-Git < 0.10.0.
  6d6d897b54 * channels: Speed up =E2=80=98channel-news-for-commit=E2=80=99.

Ludo=E2=80=99.




Notification sent to Ludovic Courtès <ludo@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Ludovic Courtès <ludo@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 78432 <at> debbugs.gnu.org:


Received: (at 78432) by debbugs.gnu.org; 17 May 2025 16:53:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 17 12:53:31 2025
Received: from localhost ([127.0.0.1]:50557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uGKmw-0003DL-NZ
	for submit <at> debbugs.gnu.org; Sat, 17 May 2025 12:53:31 -0400
Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]:42577)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ian@HIDDEN>) id 1uGKmt-0003D0-KJ
 for 78432 <at> debbugs.gnu.org; Sat, 17 May 2025 12:53:28 -0400
Received: from phl-compute-09.internal (phl-compute-09.phl.internal
 [10.202.2.49])
 by mailfout.stl.internal (Postfix) with ESMTP id DEE5D11400C7;
 Sat, 17 May 2025 12:53:21 -0400 (EDT)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-09.internal (MEProxy); Sat, 17 May 2025 12:53:22 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:message-id:mime-version:reply-to
 :subject:subject:to:to; s=fm2; t=1747500801; x=1747587201; bh=RR
 WFDPjKsziqnSY9/DTVYaIQPN/ExF3H7tTd7+TnQ/A=; b=gSopf2f9aQJkKsVoCR
 Fo0tiUFlYIioTPatfddjv6oYKPnLvt//IimCymxsj4lKXjmbDTscLxNJT4AcTTPa
 +y7/SMoxA0Yhbp1u8hdshaZFS8Q3CqJnrQphfzc3VWYdCFOqx4rFvN7GTMl7QfqX
 uYmR5jucVk0kt/AA1/N4bN6Z2j7t0ofKnJZ2mT+whWC6WEnZAqbRPVOzVhRHockx
 rCj+fvMxlHahLusZYZ8q60eBCq6hRiXRfYnpBH1ZXjEhpGoRQLlyT/b4bDOiT1CZ
 1A8GoTJl9wUjzsLN1VDrSqYWoS3l0pPH5wtwtOps+Z0Xx1MHNIfFPw2UIDshGAIW
 BLjw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:message-id:mime-version:reply-to:subject
 :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm3; t=1747500801; x=1747587201; bh=RRWFDPjKsziqnSY9/DTVYaIQPN/E
 xF3H7tTd7+TnQ/A=; b=OmbpRq7wjZaJi6RnMJmiRwk2xoRJgeeVD405ABClH1fe
 3ezMeDVsOaxO5QQZCrU8+uZwhhRlaPhZpKTcOv/Q5Uj9SfkBRX5C4FwWYtIxL7w3
 FJ9Rk5495719LoPnV6+RNgvD5VJkO3qLbjemMHH9UAy45mN065WIAIucZpZEGrd7
 cXjFqefdf+qLUPxXdYNG86Is+j15G69acBNaSuv7xTkuNh0UH/mM98a/rtf9ZNAf
 UkPk+LpWgwLRDeRbrreFxOpIXmdxka/bFucjRqfg2ayI1jChqd5/AmijqQ0C+ldU
 tfjFPRpTOGCWhV1Ufsd5zO6GrvyqE4UyZ9BLXqsdAg==
X-ME-Sender: <xms:Ab8oaOh8dAQGbfe7aqFGcN41Q_RlsXYu6H1teIBsahskCbODKStMJg>
 <xme:Ab8oaPC6pytPEQ7bite4s9kwnnF1AbP1cxnr13u-V0V64lg5Krug-v-bwmtvnBo_8
 NvRiSTCzIXdfBSrWg>
X-ME-Received: <xmr:Ab8oaGGQ_rSmR4zghl1cIrHxJ58ywBSWnRhgZ-k32C6Pj1mHayq8hQXOUI6CVGiTLrdw3UgnOyUdFIF5cS1812dcvH4jtOmZ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefudeiudeiucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv
 pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih
 gvnhhtshculddquddttddmnecujfgurhephffvvefufgffkfggtgfgsehtqhertddtreej
 necuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehrvghtrhhoshhpvggtrdhtvheqne
 cuggftrfgrthhtvghrnheptdetkeffffefiefhueekvdeiueegieegffdthfelveelgfdt
 vdfhtdduheffuedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh
 hfrhhomhepihgrnhesrhgvthhrohhsphgvtgdrthhvpdhnsggprhgtphhtthhopeejpdhm
 ohguvgepshhmthhpohhuthdprhgtphhtthhopehmvgesthhosghirghsrdhgrhdprhgtph
 htthhopeiiihhmohhnrdhtohhuthhouhhnvgesghhmrghilhdrtghomhdprhgtphhtthho
 pehothhhrggtvghhvgesghhnuhdrohhrghdprhgtphhtthhopeguvghvsehjphhoihhrvg
 htrdighiiipdhrtghpthhtohepghhuihigsegtsggrihhnvghsrdhnvghtpdhrtghpthht
 ohepjeekgeefvdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehluhguoh
 esghhnuhdrohhrgh
X-ME-Proxy: <xmx:Ab8oaHQLakKs4RPbNRd4RYWyxj9U9DhPPrDkUOLriVBq9UXaYM6ivg>
 <xmx:Ab8oaLzcpPAQhkf0JnbusziDREBMKZ_4JACpNYqsalmXOQR_R9NmNg>
 <xmx:Ab8oaF6AuZr0WA2rvvH_lENsESJeZr2bSupDUv4YE8-BxyKCFmQwkQ>
 <xmx:Ab8oaIytldfT2E9l1XdC-TunIOVOXkm4HTh6AES8w1lz5C3-AQ0WYg>
 <xmx:Ab8oaDGERe7ooXQBp7-8JEQiiy9u31pSPMgtyFUMYzPUhpjz0mx1cRrU>
Feedback-ID: id9014242:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 17 May 2025 12:53:20 -0400 (EDT)
From: Ian Eure <ian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#78432] [PATCH 2/2] git: Remove code for Guile-Git < 0.10.0.
User-Agent: mu4e 1.12.9; emacs 29.4
Date: Sat, 17 May 2025 09:53:19 -0700
Message-ID: <875xhzfabk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78432
Cc: Josselin Poiret <dev@HIDDEN>, 78432 <at> debbugs.gnu.org,
 Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>, Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Ludo=E2=80=99,

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> * guix/git.scm (commit-relation, commit-descendant?): Remove=20
> code for
> Guile-Git < 0.10.0.
> (set-git-timeouts): Remove code for Guile-Git < 0.9.0.
> (report-git-error): Remove code for ancient Guile-Git.

Both patches LGTM!

  -- Ian




Information forwarded to guix-patches@HIDDEN:
bug#78432; Package guix-patches. Full text available.

Message received at 78432 <at> debbugs.gnu.org:


Received: (at 78432) by debbugs.gnu.org; 14 May 2025 20:26:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 14 16:26:50 2025
Received: from localhost ([127.0.0.1]:46115 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFIgj-0002rI-19
	for submit <at> debbugs.gnu.org; Wed, 14 May 2025 16:26:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34234)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1uFIgg-0002q4-Gx
 for 78432 <at> debbugs.gnu.org; Wed, 14 May 2025 16:26:47 -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 <ludo@HIDDEN>)
 id 1uFIgb-000785-6a; Wed, 14 May 2025 16:26:41 -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=zneLb/17FEaBMKi6Sm+RZAdKMErmSVOsl+cZYRHTj3I=; b=QBo3oaYVp9Ht1YLQ8967
 3b0JcEFwclvC1ucl5ajIQh/xl0D5V1pxeqeWlL2PtpfnIXWLoMMLMN67IkKCw0yGdbGA6+2Lku4aW
 r/Zr7JPcfUnJkHMW7vY/8+PuWtrLh+6wYiqevvWOKpKvLjnrT0KyBdNBGMHn6fD7hr+m0OnD88Rbi
 CWDFTcRLKFEvIITU0gPWauodtQgj1k6eFT/zMca6LRSgUzKzLyXJsYlD+4aMyHKxsonVzJp0z1WAA
 +VEOwZpnKjkDi/0Pw7ASk2mT8OF75GMz0TpejAoQq7+JHKn8hvasoxpnKw22GLMyTpAvGJEAekPFe
 QeV84Hsmo1qsEA==;
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 78432 <at> debbugs.gnu.org
Subject: [PATCH 2/2] git: Remove code for Guile-Git < 0.10.0.
Date: Wed, 14 May 2025 22:26:28 +0200
Message-ID: <9b5150861b2dfdea534d00df8d1351d9f3a8a59c.1747254136.git.ludo@HIDDEN>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@HIDDEN>
References: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78432
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* guix/git.scm (commit-relation, commit-descendant?): Remove code for
Guile-Git < 0.10.0.
(set-git-timeouts): Remove code for Guile-Git < 0.9.0.
(report-git-error): Remove code for ancient Guile-Git.

Change-Id: Ie597151ce4c1e5ea006e2783fcc510caed3f566c
---
 guix/git.scm | 90 ++++++++++++++--------------------------------------
 1 file changed, 24 insertions(+), 66 deletions(-)

diff --git a/guix/git.scm b/guix/git.scm
index 9975c9b92e..c1353c5c04 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -211,15 +211,9 @@ (define (set-git-timeouts connection-timeout read-timeout)
 when talking to remote Git servers.
 
 If one of them is #f, the corresponding default setting is kept unchanged."
-  ;; 'set-server-timeout!' & co. were added in Guile-Git 0.9.0.
-  (define (defined? variable)
-    (module-defined? (resolve-interface '(git)) variable))
-
-  (when (and (defined? 'set-server-connection-timeout!)
-             connection-timeout)
+  (when connection-timeout
     (set-server-connection-timeout! connection-timeout))
-  (when (and (defined? 'set-server-timeout!)
-             read-timeout)
+  (when read-timeout
     (set-server-timeout! read-timeout)))
 
 (define* (clone* url directory #:key (verify-certificate? #t))
@@ -374,13 +368,7 @@ (define-syntax-rule (with-repository directory repository exp ...)
 
 (define (report-git-error error)
   "Report the given Guile-Git error."
-  ;; Prior to Guile-Git commit b6b2760c2fd6dfaa5c0fedb43eeaff06166b3134,
-  ;; errors would be represented by integers.
-  (match error
-    ((? integer? error)                           ;old Guile-Git
-     (leave (G_ "Git error ~a~%") error))
-    ((? git-error? error)                         ;new Guile-Git
-     (leave (G_ "Git error: ~a~%") (git-error-message error)))))
+  (leave (G_ "Git error: ~a~%") (git-error-message error)))
 
 (define-syntax-rule (with-git-error-handling body ...)
   (catch 'git-error
@@ -769,60 +757,30 @@ (define* (commit-difference new old #:optional (excluded '()))
                  (cons head result)
                  (set-insert head visited)))))))
 
-(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
+(define (commit-relation 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)."
-        (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))))))))
+  (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))))
 
-(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)))))))))))
+(define (commit-descendant? 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)))
 
 
 ;;
-- 
2.49.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#78432; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 May 2025 20:24:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 14 16:24:14 2025
Received: from localhost ([127.0.0.1]:46096 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFIeD-0002Oc-9J
	for submit <at> debbugs.gnu.org; Wed, 14 May 2025 16:24:14 -0400
Received: from lists.gnu.org ([2001:470:142::17]:56014)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1uFIeA-0002NT-Ey
 for submit <at> debbugs.gnu.org; Wed, 14 May 2025 16:24:11 -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 <ludo@HIDDEN>) id 1uFIe4-00083L-Qy
 for guix-patches@HIDDEN; Wed, 14 May 2025 16:24:05 -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 <ludo@HIDDEN>)
 id 1uFIe4-0006SO-5o; Wed, 14 May 2025 16:24:04 -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=BlNigzXycwlX5Nc/mdRj5/apnWXeAJRouV7Ps7v4kHo=; b=X7HfFuYYISWerz
 daIli+pPKysijFtx0kzOJzKdsCwIqzsoD61FHg5ziGy9/Q9dXGkdC1+bqWs1N/eTLiZoKNAQciz+1
 8Y+y+cP3csLZzlaCWLtoqi4RUmZqMAF4NTO9s+lA+hWQW13gJ7Wk5F+40wvfV9q00e8bIzBXBz5WY
 sGvcBYhJCHIu4K9I8n89B0cHZM1iNC2LrrtgMU2najbX7dLWn4YdyS5O7LCYGDe6PIYQ2yO0CZKs3
 PbVhrhm5Rn95an/JyfW4nkcSq3ApJauyLay6pLA2yYjdqUj4NpsNkPbnu0L7VEKB/8IT4omBuSyLt
 sMIq1kYzLhXy6KqoZkrg==;
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 1/2] =?UTF-8?q?channels:=20Speed=20up=20=E2=80=98channel-n?=
 =?UTF-8?q?ews-for-commit=E2=80=99.?=
Date: Wed, 14 May 2025 22:23:45 +0200
Message-ID: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@HIDDEN>
X-Mailer: git-send-email 2.49.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: submit
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>,
 Ian Eure <ian@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Partly fixes <https://issues.guix.gnu.org/78194>.

This makes the wall-clock time of:

  guix pull --list-generations > /dev/null

shrink from 33s to 4s on a profile with 8 generations.

* guix/channels.scm (channel-news-for-commit): Rewrite in terms of
‘commit-descendant?’.

Reported-by: Ian Eure <ian@HIDDEN>
Change-Id: I387e3dc37437e2d98bfd7ab710417f68d16146ad
---
 guix/channels.scm | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index 7a02d24a84..f6b3f40cc3 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018-2024 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2018-2025 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@HIDDEN>
 ;;; Copyright © 2021 Brice Waegeneire <brice@HIDDEN>
@@ -31,7 +31,7 @@ (define-module (guix channels)
   #:autoload   (git structs) (git-error-code)
   #:autoload   (guix git) (update-cached-checkout
                            url+commit->name
-                           commit-difference
+                           commit-descendant?
                            repository-info
                            commit-short-id
                            tag->commit
@@ -48,7 +48,6 @@ (define-module (guix channels)
   #:use-module (guix progress)
   #:use-module (guix derivations)
   #:use-module (guix diagnostics)
-  #:use-module (guix sets)
   #:use-module (guix store)
   #:use-module (guix i18n)
   #:use-module (srfi srfi-1)
@@ -1237,15 +1236,16 @@ (define* (channel-news-for-commit channel new #:optional old)
                                                                      entry))
                                    (channel-news-entries news))))
                 (if old
-                    (let* ((new     (commit-lookup repository (string->oid new)))
-                           (old     (commit-lookup repository (string->oid old)))
-                           (commits (list->set
-                                     (map (compose oid->string commit-id)
-                                          (commit-difference new old)))))
-                      (filter (lambda (entry)
-                                (set-contains? commits
-                                               (channel-news-entry-commit entry)))
-                              entries))
+                    (let ((new (commit-lookup repository (string->oid new)))
+                          (old (commit-lookup repository (string->oid old))))
+                      (take-while (lambda (entry)
+                                    (let ((entry (commit-lookup
+                                                  repository
+                                                  (string->oid
+                                                   (channel-news-entry-commit entry)))))
+                                      (and (commit-descendant? new (list entry))
+                                           (not (commit-descendant? old (list entry))))))
+                                  entries))
                     entries)))
             '())))
     (lambda (key error . rest)

base-commit: c5265b90b055ee15908298c5d463301f1aae2eb1
-- 
2.49.0





Acknowledgement sent to Ludovic Courtès <ludo@HIDDEN>:
New bug report received and forwarded. Copy sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#78432; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 18 May 2025 21:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.