From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bug-guix-bounces+larch=yhetil.org@gnu.org>
Received: from mp10.migadu.com ([2001:41d0:306:2d92::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms9.migadu.com with LMTPS
	id YDMJDkl792TFRAEAG6o9tA:P1
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 05 Sep 2023 21:02:33 +0200
Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp10.migadu.com with LMTPS
	id YDMJDkl792TFRAEAG6o9tA
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 05 Sep 2023 21:02:33 +0200
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 20607307D4
	for <larch@yhetil.org>; Tue,  5 Sep 2023 21:02:33 +0200 (CEST)
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=gqPXDMQT;
	spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org";
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none)
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1693940553;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to: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=mCfMYEy946HhJdJ3oyKFtf36lO0XRBfdG9cIIRIKuwQ=;
	b=F4HBvqpCP4GajpNfd5egx4AkS6iCzWCuPPezVuWPm/h6UXLPUg+qCDBGPgCgBDl6IaveGg
	tT/TRLq95WQGn3+2RLtbB1ME+NMm/j7Bir4wWzyczHxbyPLN3Iz+Sa4yYpjQClxFUKj0eB
	gyDGe5XMETdCZjDoIxOaV2FHHKO40ocVQVIWhXVlGUuBrDKo4VqbwXCdSR2nt8CkI88z/Q
	iBlxdxKwilhi6sB87lOuOZ1nRqGgeaD26Ye9fL6OX+2OruJBtnekOLsj3BkUzmqO8YGHLL
	0XkmpXCjiSd2eYAGlpeRhWkF3SQW8l4BscegnZiI5Pe5xQ9hVBbDzAzQwBv1Bg==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693940553; a=rsa-sha256; cv=none;
	b=aXOIr9elFQCR1IxiUNpT+cW4sFt7HeZP6kHwjHBc0YNy0fIZO8330lARpBxCj7zEi0FRsi
	Pz0FCshwdDP9hgcR1nqoV0vlOINc692V1cF9X7mnOQ4rG0+P7Y7Fn/KnKXhTxoJyjbVKsg
	YUnzXAeuO/A2irljxrowApmnis7ZYwE5nlXDqNPXzWmlQT2ujpI35upv+rCQtY72If8h5U
	qpi1hpwyx8JCxVq0OqGOz9fC02VsMgJuBkDCPrvRx47PVg5UQeSmoCPTA04wG6biJyhi+c
	f/zqR08VEnj31dQVOWXBKEl4SKOUpPfulTrFartreqTPfN+y+x1ROlAsFv18zw==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=gqPXDMQT;
	spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org";
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-guix-bounces@gnu.org>)
	id 1qdbJL-0006s0-3i; Tue, 05 Sep 2023 15:02:03 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1qdbJJ-0006rW-Jq
 for bug-guix@gnu.org; Tue, 05 Sep 2023 15:02:01 -0400
Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1qdbJJ-0006NS-Ac
 for bug-guix@gnu.org; Tue, 05 Sep 2023 15:02:01 -0400
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qdbJJ-0003tO-N9
 for bug-guix@gnu.org; Tue, 05 Sep 2023 15:02:01 -0400
X-Loop: help-debbugs@gnu.org
Subject: bug#65720: Guile-Git-managed checkouts grow way too much
Resent-From: Simon Tournier <zimon.toutoune@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-guix@gnu.org
Resent-Date: Tue, 05 Sep 2023 19:02:01 +0000
Resent-Message-ID: <handler.65720.B65720.169394048014910@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 65720
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@gnu.org>, 65720@debbugs.gnu.org
Received: via spool by 65720-submit@debbugs.gnu.org id=B65720.169394048014910
 (code B ref 65720); Tue, 05 Sep 2023 19:02:01 +0000
Received: (at 65720) by debbugs.gnu.org; 5 Sep 2023 19:01:20 +0000
Received: from localhost ([127.0.0.1]:59287 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1qdbId-0003sQ-RT
 for submit@debbugs.gnu.org; Tue, 05 Sep 2023 15:01:20 -0400
Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:38129)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@gmail.com>) id 1qdbIZ-0003rn-Lg
 for 65720@debbugs.gnu.org; Tue, 05 Sep 2023 15:01:19 -0400
Received: by mail-wm1-x330.google.com with SMTP id
 5b1f17b1804b1-401ce65dfc4so9350215e9.0
 for <65720@debbugs.gnu.org>; Tue, 05 Sep 2023 12:01:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1693940469; x=1694545269; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=mCfMYEy946HhJdJ3oyKFtf36lO0XRBfdG9cIIRIKuwQ=;
 b=gqPXDMQTtZd2XIEOandnyWc2j/Rp+6Q8Um0a5zCjPWBKWmHEVzOzDTtybVgmW8bQky
 8jaqroq/U3ZUakSPLHPx8EYYeAJmYturVNXyaDBicIgiUpjEXIxA3xEwaLBSxFJf+Or6
 vLtCJX9Ev4eS1Tanv0S85odW88jPbuC2TzMJE9tvEGT8bG3mzilDKofBWAPyCtJRNODW
 agnLUXihkZC6b6wr/5nqE3xA+NN5WxtzX7nHJ1UOltt05N9+5ME/pLqmd6SWi0+mcgKa
 k38qnW/v/f2yZ+u86+TFgOeX+ohq5xfknn3QLpypyS65nDswhfpztWVWrEJwSIOORzWm
 DWZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1693940469; x=1694545269;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject
 :date:message-id:reply-to;
 bh=mCfMYEy946HhJdJ3oyKFtf36lO0XRBfdG9cIIRIKuwQ=;
 b=fNUEAENc6OWDaEoyMkH4+ltgXOqkX6kNquEARTuEY6q9uTYyONVl9yP9omveB2IRp3
 oAGnNZvJORdkoKXUxtWp5w2OsMjQozrgPmpqv4fqz68DBVGFkwRn9g18eXKF95WlUZYv
 AWdpnRzRa0W99XFwqBTs9s4Go6dF66hQrm9tTzKTQ0foCh1Aubt1a9/HMI2yzWPKFqaz
 jzzcHbQSfH6I+R2PdVIXTiNECO1io3kV5dYHYj/Bhje7l8Yq7A4b/0liStUBwRlsTJso
 dtRlvpTKTEfIUFXM0QLRDGDL+eGVa9vZ7Z3hKjAKIVVT9uljEY3n+r5tFwd4c1PiMVJC
 n0Xw==
X-Gm-Message-State: AOJu0Yw4cAQSirTYFkQOfP1peKs8lIEBunhaQwxXPdgnIhXKiaXwgJ0B
 K0r5fIbUFelB8SX+dE55dSPDU+oRwQQ=
X-Google-Smtp-Source: AGHT+IGqfVbO7szTpGsEGwU/DGl9YdLE1sHWu/1G247m6RjDE09ds/itQgaLLpMAwm/cMo4OcywgsQ==
X-Received: by 2002:a05:6000:141:b0:31a:e29f:5eab with SMTP id
 r1-20020a056000014100b0031ae29f5eabmr9325264wrx.7.1693940468913; 
 Tue, 05 Sep 2023 12:01:08 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 bt9-20020a056000080900b0031c5ce91ad6sm14297502wrb.97.2023.09.05.12.01.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 05 Sep 2023 12:01:08 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@gmail.com>
In-Reply-To: <87fs3tobju.fsf@gnu.org>
References: <87bkejc7go.fsf@inria.fr> <87fs3tobju.fsf@gnu.org>
Date: Tue, 05 Sep 2023 20:59:07 +0200
Message-ID: <86edjcqwec.fsf@gmail.com>
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: bug-guix@gnu.org
List-Id: Bug reports for GNU Guix <bug-guix.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-guix>,
 <mailto:bug-guix-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-guix>
List-Post: <mailto:bug-guix@gnu.org>
List-Help: <mailto:bug-guix-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-guix>,
 <mailto:bug-guix-request@gnu.org?subject=subscribe>
Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org
Sender: bug-guix-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
X-Migadu-Scanner: mx2.migadu.com
X-Spam-Score: -5.12
X-Migadu-Queue-Id: 20607307D4
X-Migadu-Spam-Score: -5.12
X-TUID: hZkn6jvOJ2i9

Hi,

On Mon, 04 Sep 2023 at 23:47, Ludovic Court=C3=A8s <ludo@gnu.org> wrote:

>> It would seem that libgit2 doesn=E2=80=99t do the equivalent of =E2=80=
=98git gc=E2=80=99.
>
> Confirmed: <https://github.com/libgit2/libgit2/issues/3247>.

Ouch!

        The goals of the project haven't changed, and neither have the
        tradeoffs. If one were to rewrite git-gc on top of libgit2, the
        best-case scenario is ending up with what we already had.

        If you want to use regular maintenance on some repostories, use
        git gc, that's what it's there for.

        https://github.com/libgit2/libgit2/issues/3247#issuecomment-1525080=
40

> My inclination for the short term would be to work around this
> limitation by (1) finding a heuristic to determine is a checkout has
> likely accumulated too much cruft, and (2) considering such checkouts
> as expired (thereby forcing a re-clone) or running =E2=80=98git gc=E2=80=
=99 on them if
> =E2=80=98git=E2=80=99 is available.

About (1) maybe we could add a =E2=80=9Ccounter=E2=80=9D and teach after X =
updates of
the checkout then let run (2).  Well, I guess the number of crufts is
more or less proportional with the number of checkout updates; that=E2=80=
=99s
the heuristic I would use.

The most annoying is (2).  Because forcing a re-clone does not appear to
me a solution; I prefer to waste disk space (and probably run myself and
manually =E2=80=98git gc=E2=80=99) than re-clone=E2=80=A6 Somehow this re-c=
lone would always
happen when I am using a poor network.

Moreover, assuming this clean-up (2) would be run once every while, we
could imagine to invoke something like,

    guix shell -C git-minimal
         -- git
         -C ~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr2=
7shj7apsnalwq
         gc

when the checkout is updated.  And maybe we could provide another =E2=80=9C=
guix
pull=E2=80=9D command-line option for turning off this and mark it as done
(reset the =E2=80=9Ccounter=E2=80=9D).

Well, that=E2=80=99s a poor solution but we can assume that git-minimal is =
at
worse available using =E2=80=9Cguix shell git-minimal=E2=80=9D.  Note that =
the closure
of git-minimal is far less than re-cloning the full Guix repository.

Cheers,
simon