From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id aPJpNowMVmX9WwAAG6o9tA:P1 (envelope-from ) for ; Thu, 16 Nov 2023 13:35:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aPJpNowMVmX9WwAAG6o9tA (envelope-from ) for ; Thu, 16 Nov 2023 13:35:25 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C6BAE164D7 for ; Thu, 16 Nov 2023 13:35:24 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=ZFjlK3F4; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700138124; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ZEuFNinQlxo+OxQc1igD8XwkMi/joiRI0BI6c1SFqec=; b=IwdlcW1djUKdR8xl8rZN/cqWZ8zqPdg93IicxknHPAKIakt5JwsCDfgaooU42WEpDqnMZw dC5o+5MMPayx9jbcME8X7+r16QbWpBh8xcsYta4b2scs0Ju/4uqxKr1IIDiLlQqim081wK MNkomG8zzsEaXaVYMPIKkoRHgJ1+mK9pImovsT/OEA1InwUxxHNedtvvs1M6mMf7V4jzuA SSIOV4teDNPed/C5uu4IPxLCugouMnIVdl0Rm7g0ovJEL8ZEs8pIRhYCkDKbHNZTDHryFJ qvrpxFi7u1s0e8buh5c5ZLWlEDhoCZ6yrIUWFlTLBMDZqhgObtsBs8vRlfcMng== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=ZFjlK3F4; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1700138124; a=rsa-sha256; cv=none; b=NPEuVJF4U3Fln8mYWW+YMKsm/fc/38ROsqCBdcOdKmHRIl6PMI6wFpvTn0mi7dP97ZDCOu muGZ81nwWRwpeHYM2e9OBD9eP0HSklculp4t4zX9PiHW/8n627NMm48FGR/gYXRMDplYMA GHHMJ1KsrA9Hs9P8vzJGf9+1GwTZH/S8Jnp7mEERKtL8qJa91FI0SqhiDzLZVhjDXopLL5 48FlMLCOatQn5qwM7TXYtJGENCXVP7saJDet15J4KCwe6e40Fqv/6ITUP1Pl+txl54T+8Y KKyos+gX6Vuyu0mXYwaHcRCo34nvjLhe8roXnyjgGfnsN4HJmTf+UJbnRVaQUA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3bF3-0000yG-JT; Thu, 16 Nov 2023 07:13:05 -0500 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 1r3bF1-0000xX-Gj for guix-patches@gnu.org; Thu, 16 Nov 2023 07:13:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3bF1-0001Gv-7s for guix-patches@gnu.org; Thu, 16 Nov 2023 07:13:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3bF0-0006yd-PF for guix-patches@gnu.org; Thu, 16 Nov 2023 07:13:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66650] bug#65720: [bug#66650] [PATCH] git: Shell out to =?UTF-8?Q?=E2=80=98git_?= =?UTF-8?Q?gc=E2=80=99?= when necessary. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Nov 2023 12:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66650 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Simon Tournier Cc: Josselin Poiret , Christopher Baines , 65720@debbugs.gnu.org, 66650@debbugs.gnu.org Received: via spool by 66650-submit@debbugs.gnu.org id=B66650.170013675126757 (code B ref 66650); Thu, 16 Nov 2023 12:13:02 +0000 Received: (at 66650) by debbugs.gnu.org; 16 Nov 2023 12:12:31 +0000 Received: from localhost ([127.0.0.1]:54656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3bEV-0006xS-HR for submit@debbugs.gnu.org; Thu, 16 Nov 2023 07:12:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3bEU-0006x9-HC; Thu, 16 Nov 2023 07:12:30 -0500 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 1r3bEO-0001BF-E9; Thu, 16 Nov 2023 07:12:24 -0500 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=ZEuFNinQlxo+OxQc1igD8XwkMi/joiRI0BI6c1SFqec=; b=ZFjlK3F4OWU+fez3iiWz IxsLp6ZtJRjErJj/o4gtgt1JCY7E1PHVTZ4ZDEmq8mORUCPR4y6rB/DAREMu8mI6i/s/p1QDwfE3w NNmVmuW0BNR6G2inIgfnUCeavacFkv5ww/W9Q2AcbcV1oFsh5VAOgD9AoA20LjlgDhS6jADhiRDrk kdY88EHA5DJsmDNCcPAAVz6qiiCcWG5Q6Ezg8GueQzuKdHm1pBap47ThK44XZK4jbniweKJ6S6JYX UKIptuWX6hh36Zb+mowvorzPnBB7SUWV1hRc3D9Q/u4D5B1oYB3H9qR+XrFKfbu9+wZfef7YUb/uB qbKsTlXJU438Cw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <87v8a4el3a.fsf@gmail.com> (Simon Tournier's message of "Tue, 14 Nov 2023 10:32:41 +0100") References: <87jzswsrlt.fsf@gnu.org> <87sf5swc3j.fsf@cbaines.net> <87o7fwae0q.fsf@gnu.org> <87v8a4el3a.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 26 Brumaire an 232 de la =?UTF-8?Q?R=C3=A9volution, ?= jour de la Pistache X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 16 Nov 2023 13:12:22 +0100 Message-ID: <87h6ll28yh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.29 X-Spam-Score: -5.29 X-Migadu-Queue-Id: C6BAE164D7 X-Migadu-Scanner: mx10.migadu.com X-TUID: xTLOtZdUDAYp Hi, Simon Tournier skribis: >>> * guix/git.scm (packs-in-git-repository, maybe-run-git-gc): New >>> procedures. >>> (update-cached-checkout): Use it. >>> --- >>> guix/git.scm | 39 ++++++++++++++++++++++++++++++++++++--- >>> 1 file changed, 36 insertions(+), 3 deletions(-) > > LGTM. Thanks! > Just two colors for the bikeshed. :-) > > >>> + (when (> (packs-in-git-repository directory) 25) > > Why 25? And not 10 or 50 or 100? Totally arbitrary. :-) I sampled the checkouts I had on my laptop and that seems like a reasonable heuristic. In particular, it seems that Git-managed checkouts never have this many packs; only libgit2-managed checkouts do, precisely because libgit2 doesn=E2=80=99t repack/GC. >>> + ;; Run 'git gc' if needed. >>> + (maybe-run-git-gc cache-directory) > > Why not trigger it by =E2=80=9Cguix gc=E2=80=9D? Because so far the idea is that ~/.cache/guix/checkouts is automatically managed without user intervention; it=E2=80=99s really a cache in that sens= e. > Well, I expect =E2=80=9Cguix gc=E2=80=9D to take some time and I choose w= hen. However, > I want =E2=80=9Cguix pull=E2=80=9D or =E2=80=9Cguix time-machine=E2=80=9D= to be as fast as possible and > here some extra time is added, and I cannot control exactly when. Yes, I see. The thing is =E2=80=98maybe-run-git-gc=E2=80=99 is only called= on the slow path; so for example, it=E2=80=99s not called on a =E2=80=98time-machine=E2= =80=99 cache hit, but only on a cache miss, which is already expensive anyway. Does that make sense? Thanks, Ludo=E2=80=99.