diff mbox series

[v3,4/5] builtin/pack-redundant: remove subcommand with breaking changes

Message ID 20250120-pks-remote-branches-deprecation-v3-4-c7e539b6a84f@pks.im (mailing list archive)
State Superseded
Headers show
Series remote: announce removal of "branches/" and "remotes/" | expand

Commit Message

Patrick Steinhardt Jan. 20, 2025, 7:43 a.m. UTC
The git-pack-redundant(1) subcommand has been announced for removal with
53a92c9552 (Documentation/BreakingChanges: announce removal of
git-pack-redundant(1), 2024-09-02). Stop compiling the subcommand in
case the `WITH_BREAKING_CHANGES` build flag is set.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 Makefile                  | 2 ++
 git.c                     | 2 ++
 t/t5323-pack-redundant.sh | 6 ++++++
 3 files changed, 10 insertions(+)

Comments

Junio C Hamano Jan. 21, 2025, 9:09 p.m. UTC | #1
Patrick Steinhardt <ps@pks.im> writes:

> The git-pack-redundant(1) subcommand has been announced for removal with
> 53a92c9552 (Documentation/BreakingChanges: announce removal of
> git-pack-redundant(1), 2024-09-02). Stop compiling the subcommand in
> case the `WITH_BREAKING_CHANGES` build flag is set.

Nice.

The date it was added to BreakingChanges document is probably of
much lessor impact and importance to the end users than when we
stopped working unless the user gave "--i-still-use-this" which was
done by 4406522b (pack-redundant: escalate deprecation warning to an
error, 2023-03-23) that was in Git 2.41.

Other than that, I love this step.  The fewer the subcommands, the
happier the users ;-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index dc3c980aa7..e6b0d85980 100644
--- a/Makefile
+++ b/Makefile
@@ -1278,7 +1278,9 @@  BUILTIN_OBJS += builtin/mv.o
 BUILTIN_OBJS += builtin/name-rev.o
 BUILTIN_OBJS += builtin/notes.o
 BUILTIN_OBJS += builtin/pack-objects.o
+ifndef WITH_BREAKING_CHANGES
 BUILTIN_OBJS += builtin/pack-redundant.o
+endif
 BUILTIN_OBJS += builtin/pack-refs.o
 BUILTIN_OBJS += builtin/patch-id.o
 BUILTIN_OBJS += builtin/prune-packed.o
diff --git a/git.c b/git.c
index 46b3c740c5..a13c32bcdc 100644
--- a/git.c
+++ b/git.c
@@ -589,7 +589,9 @@  static struct cmd_struct commands[] = {
 	{ "name-rev", cmd_name_rev, RUN_SETUP },
 	{ "notes", cmd_notes, RUN_SETUP },
 	{ "pack-objects", cmd_pack_objects, RUN_SETUP },
+#ifndef WITH_BREAKING_CHANGES
 	{ "pack-redundant", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT },
+#endif
 	{ "pack-refs", cmd_pack_refs, RUN_SETUP },
 	{ "patch-id", cmd_patch_id, RUN_SETUP_GENTLY | NO_PARSEOPT },
 	{ "pickaxe", cmd_blame, RUN_SETUP },
diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 8dbbcc5e51..688cd9706c 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -36,6 +36,12 @@  relationship between packs and objects is as follows:
 
 . ./test-lib.sh
 
+if ! test_have_prereq WITHOUT_BREAKING_CHANGES
+then
+	skip_all='skipping git-pack-redundant tests; built with breaking changes'
+	test_done
+fi
+
 main_repo=main.git
 shared_repo=shared.git