]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/refs: add optimize subcommand
authorMeet Soni <meetsoni3017@gmail.com>
Fri, 19 Sep 2025 08:26:45 +0000 (13:56 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2025 17:02:56 +0000 (10:02 -0700)
commitecc70a48a5ea5e568b1cbdd111f7ddba62dbe4d6
tree5377caf8c2efc08d1011e0c538a27304c14dc29d
parent93efe34f5a9a6ef705e6f55d46852717ce242340
builtin/refs: add optimize subcommand

As part of the ongoing effort to consolidate reference handling,
introduce a new `optimize` subcommand. This command provides the same
functionality and exit-code behavior as `git pack-refs`, serving as its
modern replacement.

Implement `cmd_refs_optimize` by having it call the `pack_refs_core()`
helper function. This helper was factored out of the original
`cmd_pack_refs` in a preceding commit, allowing both commands to share
the same core logic as independent peers.

Add documentation for the new command. The man page leverages the shared
options file, created in a previous commit, by using the AsciiDoc
`include::` macro to ensure consistency with git-pack-refs(1).

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-refs.adoc
builtin/refs.c