threads / rfc / 59461

RFC patchpack-redundant: escalate deprecation warning to an error

Subject: [RFC/PATCH] pack-redundant: escalate deprecation warning to an error

## tl;dr

5 messages between Mar 23, 2023 and Mar 28, 2023. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Jeff King· Mar 23, 2023, 20:40 UTC · lore

In c3b58472be2 (pack-redundant: gauge the usage before proposing its removal, 2020-08-25), we added a big, ugly warning when pack-redundant is run. The plan there indicated that we would ratchet that up to an error before finally removing it. Since it has been 2.5 years (and 9 releases) since then, let's continue with the plan.

Note that we did get one bite on the warning, which was somebody asking about alternatives:

  https://lore.kernel.org/git/CAKvOHKAFXQwt4D8yUCCkf_TQL79mYaJ=KAKhtpDNTvHJFuX1NA@mail.gmail.com/

but we didn't undo the ugly warning (and the advice continues to be "use repack -d" instead).

There was also some discussion around the time of the deprecation that pack-redundant was invoked by the bitbake tool, and it still seems to do so now:

  https://git.openembedded.org/bitbake

That use should probably just go away in favor of an occasional repack (which probably even happens via auto-gc after fetch these days).

But since neither of those data points caused us to cancel the deprecation plan by dropping the warning, it seems like we should proceed with the next step.

Signed-off-by: Jeff King <peff@peff.net>
---
I was looking in this file recently, and was reminded of the deprecation
plan. The two data points above do give me a little bit of pause, but it
seems like the current state is the worst of both worlds: we do not have
the benefit of dropping the code, and people who try to use the command
have a bad experience. So we should probably either proceed (as with
this patch), or decide we need to keep pack-redundant.
 builtin/pack-redundant.c | 1 +
 1 file changed, 1 insertion(+)
Show changes to builtin/pack-redundant.c +1 −0
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index 82115c5808c..5e93d873208 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -604,6 +604,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix)
 			"option, '--i-still-use-this', on the command line\n"
 			"and let us know you still use it by sending an e-mail\n"
 			"to <git@vger.kernel.org>.  Thanks.\n"), stderr);
+		die(_("refusing to run without --i-still-use-this"));
 	}
 
 	if (load_all_packs)
-- 
2.40.0.597.ge37e901cd8f
Junio C Hamano· Mar 23, 2023, 20:56 UTC · re: Jeff King · lore

Re: [RFC/PATCH] pack-redundant: escalate deprecation warning to an error

Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> I was looking in this file recently, and was reminded of the deprecation
> plan. The two data points above do give me a little bit of pause, but it
> seems like the current state is the worst of both worlds: we do not have
> the benefit of dropping the code, and people who try to use the command
> have a bad experience. So we should probably either proceed (as with
> this patch), or decide we need to keep pack-redundant.
Sounds like a good thing to do.  Will queue.  Thanks.
Show 16 quoted lines
>
>  builtin/pack-redundant.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
> index 82115c5808c..5e93d873208 100644
> --- a/builtin/pack-redundant.c
> +++ b/builtin/pack-redundant.c
> @@ -604,6 +604,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix)
>  			"option, '--i-still-use-this', on the command line\n"
>  			"and let us know you still use it by sending an e-mail\n"
>  			"to <git@vger.kernel.org>.  Thanks.\n"), stderr);
> +		die(_("refusing to run without --i-still-use-this"));
>  	}
>  
>  	if (load_all_packs)
Taylor Blau· Mar 23, 2023, 21:16 UTC · re: Junio C Hamano · lore

Re: [RFC/PATCH] pack-redundant: escalate deprecation warning to an error

On Thu, Mar 23, 2023 at 01:56:26PM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> writes:
>
> > I was looking in this file recently, and was reminded of the deprecation
> > plan. The two data points above do give me a little bit of pause, but it
> > seems like the current state is the worst of both worlds: we do not have
> > the benefit of dropping the code, and people who try to use the command
> > have a bad experience. So we should probably either proceed (as with
> > this patch), or decide we need to keep pack-redundant.
>
> Sounds like a good thing to do.  Will queue.  Thanks.

Yeah, I agree with and am persuaded by the "worst of both worlds" argument. I think that changing this to a die() is sensible for now.

At what point would it be fair to drop this builtin entirely from the tree?

Thanks, Taylor

Junio C Hamano· Mar 23, 2023, 21:23 UTC · re: Taylor Blau · lore

Re: [RFC/PATCH] pack-redundant: escalate deprecation warning to an error

Taylor Blau <me@ttaylorr.com> writes:
Show 17 quoted lines
> On Thu, Mar 23, 2023 at 01:56:26PM -0700, Junio C Hamano wrote:
>> Jeff King <peff@peff.net> writes:
>>
>> > I was looking in this file recently, and was reminded of the deprecation
>> > plan. The two data points above do give me a little bit of pause, but it
>> > seems like the current state is the worst of both worlds: we do not have
>> > the benefit of dropping the code, and people who try to use the command
>> > have a bad experience. So we should probably either proceed (as with
>> > this patch), or decide we need to keep pack-redundant.
>>
>> Sounds like a good thing to do.  Will queue.  Thanks.
>
> Yeah, I agree with and am persuaded by the "worst of both worlds"
> argument. I think that changing this to a die() is sensible for now.
>
> At what point would it be fair to drop this builtin entirely from the
> tree?

I notice that "git pack-redundant --help" does not say anything about its deprecation. We probably should add one together with the patch in question, and then consider that the count-down timer has finally started.

The timer should last probably for at least a few cycles.
Jeff King· Mar 28, 2023, 19:06 UTC · re: Junio C Hamano · lore

[PATCH] pack-redundant: document deprecation

On Thu, Mar 23, 2023 at 02:23:46PM -0700, Junio C Hamano wrote:
> I notice that "git pack-redundant --help" does not say anything
> about its deprecation.  We probably should add one together with
> the patch in question, and then consider that the count-down timer
> has finally started.
Good thinking. Here is a patch.
-- >8 --
Subject: [PATCH] pack-redundant: document deprecation

Running the command itself has generated a warning for several versions, which has recently been upgraded to an error. Let's also make sure the documentation mentions what is going on. This also gives us a good spot to explain the reasoning and recommend alternatives.

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/git-pack-redundant.txt | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Show changes to Documentation/git-pack-redundant.txt +14 −0
diff --git a/Documentation/git-pack-redundant.txt b/Documentation/git-pack-redundant.txt
index 99ef13839d4..13c3eb5ec96 100644
--- a/Documentation/git-pack-redundant.txt
+++ b/Documentation/git-pack-redundant.txt
@@ -11,6 +11,20 @@ SYNOPSIS
 [verse]
 'git pack-redundant' [--verbose] [--alt-odb] (--all | <pack-filename>...)
 
+WARNING
+-------
+`git pack-redundant` has been deprecated and is scheduled for removal in
+a future version of Git. Because it can only remove entire duplicate
+packs and not individual duplicate objects, it is generally not a useful
+tool for reducing repository size. You are better off using `git gc` to
+do so, which will put objects into a new pack, removing duplicates.
+
+Running `pack-redundant` without the `--i-still-use-this` flag will fail
+in this release. If you believe you have a use case for which
+`pack-redundant` is better suited and oppose this removal, please
+contact the Git mailing list at git@vger.kernel.org. More information
+about the list is available at https://git-scm.com/community.
+
 DESCRIPTION
 -----------
 This program computes which packs in your repository
-- 
2.40.0.616.gf524ec75088

← back to recent threads