]> git.ipfire.org Git - thirdparty/git.git/commit
maintenance: add 'is-needed' subcommand
authorKarthik Nayak <karthik.188@gmail.com>
Sat, 8 Nov 2025 21:51:57 +0000 (22:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Nov 2025 17:28:48 +0000 (09:28 -0800)
commit28b83e6f08ae022d54d79e518e72933ae0930091
tree4605e54bdb7ee213327f39aa67b600326da26b3c
parent8c1ce2204cc755bdafec85aaa4ac9c5a686a8bf4
maintenance: add 'is-needed' subcommand

The 'git-maintenance(1)' command provides tooling to run maintenance
tasks over Git repositories. The 'run' subcommand, as the name suggests,
runs the maintenance tasks. When used with the '--auto' flag, it uses
heuristics to determine if the required thresholds are met for running
said maintenance tasks.

There is however a lack of insight into these heuristics. Meaning, the
checks are linked to the execution.

Add a new 'is-needed' subcommand to 'git-maintenance(1)' which allows
users to simply check if it is needed to run maintenance without
performing it.

This subcommand can check if it is needed to run maintenance without
actually running it. Ideally it should be used with the '--auto' flag,
which would allow users to check if the thresholds required are met. The
subcommand also supports the '--task' flag which can be used to check
specific maintenance tasks.

While adding the respective tests in 't/t7900-maintenance.sh', remove a
duplicate of the test: 'worktree-prune task with --auto honors
maintenance.worktree-prune.auto'.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-maintenance.adoc
builtin/gc.c
t/t7900-maintenance.sh