Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)
On Mon, Jun 1, 2026, at 09:56, Patrick Steinhardt wrote:
Show 28 quoted lines
> The git-init-db(1) command was initially only initializing the object
> database of a Git repository. This has changed over time so that the
> command also initializes all the other data structures, which is why we
> have eventually introduced git-init(1) as a more aptly named replacement
> for it.
>
> This has all happened in 2007 already, and with 5c94f87e6b (use 'init'
> instead of 'init-db' for shipped docs and tools, 2007-01-12) we have
> also adapted all user-facing documentation to mention the replacement.
> It is thus safe to assume that (almost) nobody uses git-init-db(1)
> nowadays anymore.
>
> Deprecate the command in favor of git-init(1) and wire up the removal
> when compiling Git with breaking changes enabled.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>[snip]
> diff --git a/git.c b/git.c
> index a72394b599..6bf6a60360 100644
> --- a/git.c
> +++ b/git.c
> @@ -591,7 +591,9 @@ static struct cmd_struct commands[] = {
> { "hook", cmd_hook, RUN_SETUP_GENTLY },
> { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },
> { "init", cmd_init },
> +#ifndef WITH_BREAKING_CHANGES
> { "init-db", cmd_init },This can be marked as deprecated.
{ "init-db", cmd_init, DEPRECATED },Show 5 quoted lines
> +#endif
> { "interpret-trailers", cmd_interpret_trailers, RUN_SETUP_GENTLY },
> { "last-modified", cmd_last_modified, RUN_SETUP },
> { "log", cmd_log, RUN_SETUP },
>[snip]