{"thread":{"id":"65724","subject":"[PATCH 0/2] Deprecate git-init-db(1) alias","startedAt":"2026-06-01T07:56:05Z","lastAt":"2026-06-02T15:24:46Z","messageCount":20,"participants":["Patrick Steinhardt","Kristoffer Haugsbakk","Phillip Wood","Junio C Hamano","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"544349","messageId":"20260601-pks-deprecate-git-init-db-v1-0-ea3e6eebe674@pks.im","threadId":"65724","inReplyTo":null,"subject":"[PATCH 0/2] Deprecate git-init-db(1) alias","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-01T07:55:58Z","receivedAt":"2026-06-01T07:56:05Z","isPatch":true,"body":"Hi,\n\nthis small patch series deprecates the git-init-db(1) alias in favor of\ngit-init(1).\n\nPatrick\n\n---\nPatrick Steinhardt (2):\n      builtin/init-db: rename to \"builtin/init.c\"\n      builtin/init-db: deprecate alias for git-init(1)\n\n Documentation/BreakingChanges.adoc | 3 +++\n Documentation/Makefile             | 1 +\n Documentation/git-init-db.adoc     | 5 +++++\n Documentation/meson.build          | 2 +-\n Makefile                           | 4 ++--\n builtin.h                          | 2 +-\n builtin/{init-db.c => init.c}      | 8 ++++----\n git.c                              | 6 ++++--\n meson.build                        | 2 +-\n t/t5502-quickfetch.sh              | 4 ++--\n t/t5503-tagfollow.sh               | 2 +-\n 11 files changed, 25 insertions(+), 14 deletions(-)\n\n\n---\nbase-commit: 1666c1265231b0bc5f613fbbf3f0a9896cdef76e\nchange-id: 20260601-pks-deprecate-git-init-db-c0e8d7f8b94e\n\n"},{"id":"544350","messageId":"20260601-pks-deprecate-git-init-db-v1-1-ea3e6eebe674@pks.im","threadId":"65724","inReplyTo":"20260601-pks-deprecate-git-init-db-v1-0-ea3e6eebe674@pks.im","subject":"[PATCH 1/2] builtin/init-db: rename to \"builtin/init.c\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-01T07:55:59Z","receivedAt":"2026-06-01T07:56:06Z","isPatch":true,"body":"Rename \"builtin/init-db.c\" to \"builtin/init.c\" to match the modern\ngit-init(1) command name instead of its ancient alias git-init-db(1).\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Makefile                      | 4 ++--\n builtin.h                     | 2 +-\n builtin/{init-db.c => init.c} | 8 ++++----\n git.c                         | 4 ++--\n meson.build                   | 2 +-\n 5 files changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b31ecb0756..b03f74ee8c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -894,7 +894,7 @@ BUILT_INS += git-cherry-pick$X\n BUILT_INS += git-format-patch$X\n BUILT_INS += git-format-rev$X\n BUILT_INS += git-fsck-objects$X\n-BUILT_INS += git-init$X\n+BUILT_INS += git-init-db$X\n BUILT_INS += git-maintenance$X\n BUILT_INS += git-merge-subtree$X\n BUILT_INS += git-restore$X\n@@ -1428,7 +1428,7 @@ BUILTIN_OBJS += builtin/help.o\n BUILTIN_OBJS += builtin/history.o\n BUILTIN_OBJS += builtin/hook.o\n BUILTIN_OBJS += builtin/index-pack.o\n-BUILTIN_OBJS += builtin/init-db.o\n+BUILTIN_OBJS += builtin/init.o\n BUILTIN_OBJS += builtin/interpret-trailers.o\n BUILTIN_OBJS += builtin/last-modified.o\n BUILTIN_OBJS += builtin/log.o\ndiff --git a/builtin.h b/builtin.h\nindex 4e47a4ebd3..bd072aa0e4 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -200,7 +200,7 @@ int cmd_help(int argc, const char **argv, const char *prefix, struct repository\n int cmd_history(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_hook(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_index_pack(int argc, const char **argv, const char *prefix, struct repository *repo);\n-int cmd_init_db(int argc, const char **argv, const char *prefix, struct repository *repo);\n+int cmd_init(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_interpret_trailers(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_last_modified(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_log_reflog(int argc, const char **argv, const char *prefix, struct repository *repo);\ndiff --git a/builtin/init-db.c b/builtin/init.c\nsimilarity index 98%\nrename from builtin/init-db.c\nrename to builtin/init.c\nindex c55517ad94..9184f2fc2c 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init.c\n@@ -69,10 +69,10 @@ static const char *const init_db_usage[] = {\n  * On the other hand, it might just make lookup slower and messier. You\n  * be the judge.  The default case is to have one DB per managed directory.\n  */\n-int cmd_init_db(int argc,\n-\t\tconst char **argv,\n-\t\tconst char *prefix,\n-\t\tstruct repository *repo UNUSED)\n+int cmd_init(int argc,\n+\t     const char **argv,\n+\t     const char *prefix,\n+\t     struct repository *repo UNUSED)\n {\n \tchar *git_dir;\n \tconst char *real_git_dir = NULL;\ndiff --git a/git.c b/git.c\nindex 36f08891ef..a72394b599 100644\n--- a/git.c\n+++ b/git.c\n@@ -590,8 +590,8 @@ static struct cmd_struct commands[] = {\n \t{ \"history\", cmd_history, RUN_SETUP },\n \t{ \"hook\", cmd_hook, RUN_SETUP_GENTLY },\n \t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },\n-\t{ \"init\", cmd_init_db },\n-\t{ \"init-db\", cmd_init_db },\n+\t{ \"init\", cmd_init },\n+\t{ \"init-db\", cmd_init },\n \t{ \"interpret-trailers\", cmd_interpret_trailers, RUN_SETUP_GENTLY },\n \t{ \"last-modified\", cmd_last_modified, RUN_SETUP },\n \t{ \"log\", cmd_log, RUN_SETUP },\ndiff --git a/meson.build b/meson.build\nindex 064fe2e2f1..682e46e7eb 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -634,7 +634,7 @@ builtin_sources = [\n   'builtin/history.c',\n   'builtin/hook.c',\n   'builtin/index-pack.c',\n-  'builtin/init-db.c',\n+  'builtin/init.c',\n   'builtin/interpret-trailers.c',\n   'builtin/last-modified.c',\n   'builtin/log.c',\n\n-- \n2.54.0.926.g75ba10bac6.dirty\n\n"},{"id":"544351","messageId":"20260601-pks-deprecate-git-init-db-v1-2-ea3e6eebe674@pks.im","threadId":"65724","inReplyTo":"20260601-pks-deprecate-git-init-db-v1-0-ea3e6eebe674@pks.im","subject":"[PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-01T07:56:00Z","receivedAt":"2026-06-01T07:56:15Z","isPatch":true,"body":"The git-init-db(1) command was initially only initializing the object\ndatabase of a Git repository. This has changed over time so that the\ncommand also initializes all the other data structures, which is why we\nhave eventually introduced git-init(1) as a more aptly named replacement\nfor it.\n\nThis has all happened in 2007 already, and with 5c94f87e6b (use 'init'\ninstead of 'init-db' for shipped docs and tools, 2007-01-12) we have\nalso adapted all user-facing documentation to mention the replacement.\nIt is thus safe to assume that (almost) nobody uses git-init-db(1)\nnowadays anymore.\n\nDeprecate the command in favor of git-init(1) and wire up the removal\nwhen compiling Git with breaking changes enabled.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/BreakingChanges.adoc | 3 +++\n Documentation/Makefile             | 1 +\n Documentation/git-init-db.adoc     | 5 +++++\n Documentation/meson.build          | 2 +-\n Makefile                           | 2 +-\n git.c                              | 2 ++\n t/t5502-quickfetch.sh              | 4 ++--\n t/t5503-tagfollow.sh               | 2 +-\n 8 files changed, 16 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc\nindex 73bb939359..89b7482f54 100644\n--- a/Documentation/BreakingChanges.adoc\n+++ b/Documentation/BreakingChanges.adoc\n@@ -300,6 +300,9 @@ references.\n +\n These features will be removed.\n \n+* The git-init-db(1) command is an alias for its modern drop-in replacement\n+  git-init(1). The alias will be removed.\n+\n * Support for \"--stdin\" option in the \"name-rev\" command was\n   deprecated (and hidden from the documentation) in the Git 2.40\n   timeframe, in preference to its synonym \"--annotate-stdin\".  Git 3.0\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 2699f0b24a..3769856b58 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -541,6 +541,7 @@ lint-docs-meson:\n \t\tsort >tmp-meson-diff/meson.adoc && \\\n \tls git*.adoc scalar.adoc | \\\n \t\tgrep -v -e git-bisect-lk2009.adoc \\\n+\t\t\t-e git-init-db.adoc \\\n \t\t\t-e git-pack-redundant.adoc \\\n \t\t\t-e git-tools.adoc \\\n \t\t\t-e git-whatchanged.adoc \\\ndiff --git a/Documentation/git-init-db.adoc b/Documentation/git-init-db.adoc\nindex 18bf1a3c8c..9802fc9f3d 100644\n--- a/Documentation/git-init-db.adoc\n+++ b/Documentation/git-init-db.adoc\n@@ -11,6 +11,11 @@ SYNOPSIS\n [verse]\n 'git init-db' [-q | --quiet] [--bare] [--template=<template-directory>] [--separate-git-dir <git-dir>] [--shared[=<permissions>]]\n \n+WARNING\n+-------\n+\n+`git init-db` has been deprecated in favor of `git init`, which is a drop-in\n+replacement for `git init-db`.\n \n DESCRIPTION\n -----------\ndiff --git a/Documentation/meson.build b/Documentation/meson.build\nindex f4854f802d..0f127d752d 100644\n--- a/Documentation/meson.build\n+++ b/Documentation/meson.build\n@@ -72,7 +72,6 @@ manpages = {\n   'git-http-push.adoc' : 1,\n   'git-imap-send.adoc' : 1,\n   'git-index-pack.adoc' : 1,\n-  'git-init-db.adoc' : 1,\n   'git-init.adoc' : 1,\n   'git-instaweb.adoc' : 1,\n   'git-interpret-trailers.adoc' : 1,\n@@ -212,6 +211,7 @@ manpages = {\n }\n \n manpages_breaking_changes = {\n+  'git-init-db.adoc' : 1,\n   'git-pack-redundant.adoc' : 1,\n   'git-whatchanged.adoc' : 1,\n }\ndiff --git a/Makefile b/Makefile\nindex b03f74ee8c..4420231753 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -894,7 +894,6 @@ BUILT_INS += git-cherry-pick$X\n BUILT_INS += git-format-patch$X\n BUILT_INS += git-format-rev$X\n BUILT_INS += git-fsck-objects$X\n-BUILT_INS += git-init-db$X\n BUILT_INS += git-maintenance$X\n BUILT_INS += git-merge-subtree$X\n BUILT_INS += git-restore$X\n@@ -904,6 +903,7 @@ BUILT_INS += git-status$X\n BUILT_INS += git-switch$X\n BUILT_INS += git-version$X\n ifndef WITH_BREAKING_CHANGES\n+BUILT_INS += git-init-db$X\n BUILT_INS += git-whatchanged$X\n endif\n \ndiff --git a/git.c b/git.c\nindex a72394b599..6bf6a60360 100644\n--- a/git.c\n+++ b/git.c\n@@ -591,7 +591,9 @@ static struct cmd_struct commands[] = {\n \t{ \"hook\", cmd_hook, RUN_SETUP_GENTLY },\n \t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },\n \t{ \"init\", cmd_init },\n+#ifndef WITH_BREAKING_CHANGES\n \t{ \"init-db\", cmd_init },\n+#endif\n \t{ \"interpret-trailers\", cmd_interpret_trailers, RUN_SETUP_GENTLY },\n \t{ \"last-modified\", cmd_last_modified, RUN_SETUP },\n \t{ \"log\", cmd_log, RUN_SETUP },\ndiff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh\nindex b160f8b7fb..a2b62f551a 100755\n--- a/t/t5502-quickfetch.sh\n+++ b/t/t5502-quickfetch.sh\n@@ -25,7 +25,7 @@ test_expect_success 'clone without alternate' '\n \t(\n \t\tmkdir cloned &&\n \t\tcd cloned &&\n-\t\tgit init-db &&\n+\t\tgit init &&\n \t\tgit remote add -f origin ..\n \t) &&\n \tcnt=$( (\n@@ -94,7 +94,7 @@ test_expect_success 'quickfetch should not copy from alternate' '\n \t(\n \t\tmkdir quickclone &&\n \t\tcd quickclone &&\n-\t\tgit init-db &&\n+\t\tgit init &&\n \t\t(cd ../.git/objects && pwd) >.git/objects/info/alternates &&\n \t\tgit remote add origin .. &&\n \t\tgit fetch -k -k\ndiff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh\nindex febe441041..31ec352c5c 100755\n--- a/t/t5503-tagfollow.sh\n+++ b/t/t5503-tagfollow.sh\n@@ -32,7 +32,7 @@ test_expect_success setup '\n \t(\n \t\tmkdir cloned &&\n \t\tcd cloned &&\n-\t\tgit init-db &&\n+\t\tgit init &&\n \t\tgit remote add -f origin ..\n \t) &&\n \n\n-- \n2.54.0.926.g75ba10bac6.dirty\n\n"},{"id":"544374","messageId":"276a92ac-b2cb-4a89-96d0-9071ab6200be@app.fastmail.com","threadId":"65724","inReplyTo":"20260601-pks-deprecate-git-init-db-v1-2-ea3e6eebe674@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-06-01T09:31:46Z","receivedAt":"2026-06-01T09:32:08Z","isPatch":true,"body":"On Mon, Jun 1, 2026, at 09:56, Patrick Steinhardt wrote:\n> The git-init-db(1) command was initially only initializing the object\n> database of a Git repository. This has changed over time so that the\n> command also initializes all the other data structures, which is why we\n> have eventually introduced git-init(1) as a more aptly named replacement\n> for it.\n>\n> This has all happened in 2007 already, and with 5c94f87e6b (use 'init'\n> instead of 'init-db' for shipped docs and tools, 2007-01-12) we have\n> also adapted all user-facing documentation to mention the replacement.\n> It is thus safe to assume that (almost) nobody uses git-init-db(1)\n> nowadays anymore.\n>\n> Deprecate the command in favor of git-init(1) and wire up the removal\n> when compiling Git with breaking changes enabled.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n>[snip]\n> diff --git a/git.c b/git.c\n> index a72394b599..6bf6a60360 100644\n> --- a/git.c\n> +++ b/git.c\n> @@ -591,7 +591,9 @@ static struct cmd_struct commands[] = {\n>  \t{ \"hook\", cmd_hook, RUN_SETUP_GENTLY },\n>  \t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },\n>  \t{ \"init\", cmd_init },\n> +#ifndef WITH_BREAKING_CHANGES\n>  \t{ \"init-db\", cmd_init },\n\nThis can be marked as deprecated.\n\n\t{ \"init-db\", cmd_init, DEPRECATED },\n\n> +#endif\n>  \t{ \"interpret-trailers\", cmd_interpret_trailers, RUN_SETUP_GENTLY },\n>  \t{ \"last-modified\", cmd_last_modified, RUN_SETUP },\n>  \t{ \"log\", cmd_log, RUN_SETUP },\n>[snip]\n"},{"id":"544376","messageId":"ah12uk7IFxS92OR1@pks.im","threadId":"65724","inReplyTo":"276a92ac-b2cb-4a89-96d0-9071ab6200be@app.fastmail.com","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-01T12:10:34Z","receivedAt":"2026-06-01T12:10:41Z","isPatch":true,"body":"On Mon, Jun 01, 2026 at 11:31:46AM +0200, Kristoffer Haugsbakk wrote:\n> On Mon, Jun 1, 2026, at 09:56, Patrick Steinhardt wrote:\n> > diff --git a/git.c b/git.c\n> > index a72394b599..6bf6a60360 100644\n> > --- a/git.c\n> > +++ b/git.c\n> > @@ -591,7 +591,9 @@ static struct cmd_struct commands[] = {\n> >  \t{ \"hook\", cmd_hook, RUN_SETUP_GENTLY },\n> >  \t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },\n> >  \t{ \"init\", cmd_init },\n> > +#ifndef WITH_BREAKING_CHANGES\n> >  \t{ \"init-db\", cmd_init },\n> \n> This can be marked as deprecated.\n> \n> \t{ \"init-db\", cmd_init, DEPRECATED },\n\nAh, indeed! Added locally now, thanks.\n\nPatrick\n"},{"id":"544385","messageId":"042e66b5-122b-4c86-a9a9-f75f763666a7@gmail.com","threadId":"65724","inReplyTo":"ah12uk7IFxS92OR1@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-06-01T13:48:05Z","receivedAt":"2026-06-01T13:48:08Z","isPatch":true,"body":"\n\nOn 01/06/2026 13:10, Patrick Steinhardt wrote:\n> On Mon, Jun 01, 2026 at 11:31:46AM +0200, Kristoffer Haugsbakk wrote:\n>> On Mon, Jun 1, 2026, at 09:56, Patrick Steinhardt wrote:\n>>> diff --git a/git.c b/git.c\n>>> index a72394b599..6bf6a60360 100644\n>>> --- a/git.c\n>>> +++ b/git.c\n>>> @@ -591,7 +591,9 @@ static struct cmd_struct commands[] = {\n>>>   \t{ \"hook\", cmd_hook, RUN_SETUP_GENTLY },\n>>>   \t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },\n>>>   \t{ \"init\", cmd_init },\n>>> +#ifndef WITH_BREAKING_CHANGES\n>>>   \t{ \"init-db\", cmd_init },\n>>\n>> This can be marked as deprecated.\n>>\n>> \t{ \"init-db\", cmd_init, DEPRECATED },\n> \n> Ah, indeed! Added locally now, thanks.\n\nDeprecating this command seems very sensible to me. As well as marking \nit deprecated, do we want to print a warning when it is run? I imagine \nanyone who has this command in their muscle memory is unlikely to be \nreading the man page on a regular basis so wont see the warning there.\n\nThanks\n\nPhillip\n\n> Patrick\n> \n\n"},{"id":"544393","messageId":"ah2VL-ftCQelNoOc@pks.im","threadId":"65724","inReplyTo":"042e66b5-122b-4c86-a9a9-f75f763666a7@gmail.com","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-01T14:20:31Z","receivedAt":"2026-06-01T14:20:37Z","isPatch":true,"body":"On Mon, Jun 01, 2026 at 02:48:05PM +0100, Phillip Wood wrote:\n> \n> \n> On 01/06/2026 13:10, Patrick Steinhardt wrote:\n> > On Mon, Jun 01, 2026 at 11:31:46AM +0200, Kristoffer Haugsbakk wrote:\n> > > On Mon, Jun 1, 2026, at 09:56, Patrick Steinhardt wrote:\n> > > > diff --git a/git.c b/git.c\n> > > > index a72394b599..6bf6a60360 100644\n> > > > --- a/git.c\n> > > > +++ b/git.c\n> > > > @@ -591,7 +591,9 @@ static struct cmd_struct commands[] = {\n> > > >   \t{ \"hook\", cmd_hook, RUN_SETUP_GENTLY },\n> > > >   \t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },\n> > > >   \t{ \"init\", cmd_init },\n> > > > +#ifndef WITH_BREAKING_CHANGES\n> > > >   \t{ \"init-db\", cmd_init },\n> > > \n> > > This can be marked as deprecated.\n> > > \n> > > \t{ \"init-db\", cmd_init, DEPRECATED },\n> > \n> > Ah, indeed! Added locally now, thanks.\n> \n> Deprecating this command seems very sensible to me. As well as marking it\n> deprecated, do we want to print a warning when it is run? I imagine anyone\n> who has this command in their muscle memory is unlikely to be reading the\n> man page on a regular basis so wont see the warning there.\n\nI was wondering whether we want to call `you_still_use_that()` here. I\nfound it to be a bit heavy-handed as it's so trivial to replace with\ngit-init(1), but on the other hand it's a trivial thing to do.\n\nPatrick\n"},{"id":"544420","messageId":"2e266786-4ccd-4300-9b53-6f13fbaa2933@app.fastmail.com","threadId":"65724","inReplyTo":"ah2VL-ftCQelNoOc@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-06-01T21:23:44Z","receivedAt":"2026-06-01T21:24:38Z","isPatch":true,"body":"By the way I tried to find user mentions of git-init-db(1) on the\nmailing list. (First git then I tried *all* but the results did not seem\ndissimilar at all.) All I found was from last year[1] but the command\nwas used as a bug reproducer, which hints at some finger memory.\n\n🔗 1: https://lore.kernel.org/git/d8c1df4e-a4d7-4c4c-be44-b13de3d9ffea@markus-raab.org/\n\nOn Mon, Jun 1, 2026, at 16:20, Patrick Steinhardt wrote:\n> On Mon, Jun 01, 2026 at 02:48:05PM +0100, Phillip Wood wrote:\n>>[snip\n>>\n>> Deprecating this command seems very sensible to me. As well as marking it\n>> deprecated, do we want to print a warning when it is run? I imagine anyone\n>> who has this command in their muscle memory is unlikely to be reading the\n>> man page on a regular basis so wont see the warning there.\n>\n> I was wondering whether we want to call `you_still_use_that()` here.\n\nAs-is that will arguably promote the *breaking change* to right now\nsince it’s a `die(...)` function. That could be changed to be warn/die\nmodular of course.\n\nBut a simple warning message can just tell them to use git-init(1).\n\n> I found it to be a bit heavy-handed as it's so trivial to replace with\n> git-init(1), but on the other hand it's a trivial thing to do.\n\nI imagine that most potential git-init-db(1) uses will be buried in some\nscripts that haven’t been touched in years. Then the Git init might\nfail, you get errors about git-commit(1) or something not being a thing\nyou can run without a repository, and it ends up being a headscratcher\nsince the original failure gets lost.\n\nAll to say I think a simple warning would be nice. ;)\n"},{"id":"544434","messageId":"xmqqh5nl3nx3.fsf@gitster.g","threadId":"65724","inReplyTo":"ah2VL-ftCQelNoOc@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-06-01T22:18:16Z","receivedAt":"2026-06-01T22:18:18Z","isPatch":true,"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> On Mon, Jun 01, 2026 at 02:48:05PM +0100, Phillip Wood wrote:\n>> \n>> \n>> On 01/06/2026 13:10, Patrick Steinhardt wrote:\n>> > On Mon, Jun 01, 2026 at 11:31:46AM +0200, Kristoffer Haugsbakk wrote:\n>> > > On Mon, Jun 1, 2026, at 09:56, Patrick Steinhardt wrote:\n>> > > > diff --git a/git.c b/git.c\n>> > > > index a72394b599..6bf6a60360 100644\n>> > > > --- a/git.c\n>> > > > +++ b/git.c\n>> > > > @@ -591,7 +591,9 @@ static struct cmd_struct commands[] = {\n>> > > >   \t{ \"hook\", cmd_hook, RUN_SETUP_GENTLY },\n>> > > >   \t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },\n>> > > >   \t{ \"init\", cmd_init },\n>> > > > +#ifndef WITH_BREAKING_CHANGES\n>> > > >   \t{ \"init-db\", cmd_init },\n>> > > \n>> > > This can be marked as deprecated.\n>> > > \n>> > > \t{ \"init-db\", cmd_init, DEPRECATED },\n>> > \n>> > Ah, indeed! Added locally now, thanks.\n>> \n>> Deprecating this command seems very sensible to me. As well as marking it\n>> deprecated, do we want to print a warning when it is run? I imagine anyone\n>> who has this command in their muscle memory is unlikely to be reading the\n>> man page on a regular basis so wont see the warning there.\n>\n> I was wondering whether we want to call `you_still_use_that()` here. I\n> found it to be a bit heavy-handed as it's so trivial to replace with\n> git-init(1), but on the other hand it's a trivial thing to do.\n\nI personally think you_still_use_that() was a mistake.  Perhaps\nlog-family of commands were used often enough to warrant it, but not\n\"init\" that takes exactly the same variations of arguments and is\nshorter than \"init-db\".  And you_still_use_that() would not help\nscripted use all that much.\n"},{"id":"544435","messageId":"xmqqcxy93nph.fsf@gitster.g","threadId":"65724","inReplyTo":"2e266786-4ccd-4300-9b53-6f13fbaa2933@app.fastmail.com","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-06-01T22:22:50Z","receivedAt":"2026-06-01T22:22:52Z","isPatch":true,"body":"\"Kristoffer Haugsbakk\" <kristofferhaugsbakk@fastmail.com> writes:\n\n>> I found it to be a bit heavy-handed as it's so trivial to replace with\n>> git-init(1), but on the other hand it's a trivial thing to do.\n>\n> I imagine that most potential git-init-db(1) uses will be buried in some\n> scripts that haven’t been touched in years. Then the Git init might\n> fail, you get errors about git-commit(1) or something not being a thing\n> you can run without a repository, and it ends up being a headscratcher\n> since the original failure gets lost.\n>\n> All to say I think a simple warning would be nice. ;)\n\nOr just leave it without deprecation.  It does not cost much to keep\n\"init-db\", and because we expanded what \"git database\" means in\nlater versions of Git since its invention, the name still makes\nsense.  Thank Linus for not naming it \"init-odb\"---that might have\nbeen a valid excuse to rename it because it does not cover the ref\ndatabase and config database and others.\n"},{"id":"544460","messageId":"ah58IJ8DgSZYRjMM@pks.im","threadId":"65724","inReplyTo":"xmqqcxy93nph.fsf@gitster.g","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-02T06:45:52Z","receivedAt":"2026-06-02T06:46:00Z","isPatch":true,"body":"On Tue, Jun 02, 2026 at 07:22:50AM +0900, Junio C Hamano wrote:\n> \"Kristoffer Haugsbakk\" <kristofferhaugsbakk@fastmail.com> writes:\n> \n> >> I found it to be a bit heavy-handed as it's so trivial to replace with\n> >> git-init(1), but on the other hand it's a trivial thing to do.\n> >\n> > I imagine that most potential git-init-db(1) uses will be buried in some\n> > scripts that haven’t been touched in years. Then the Git init might\n> > fail, you get errors about git-commit(1) or something not being a thing\n> > you can run without a repository, and it ends up being a headscratcher\n> > since the original failure gets lost.\n> >\n> > All to say I think a simple warning would be nice. ;)\n> \n> Or just leave it without deprecation.  It does not cost much to keep\n> \"init-db\", and because we expanded what \"git database\" means in\n> later versions of Git since its invention, the name still makes\n> sense.  Thank Linus for not naming it \"init-odb\"---that might have\n> been a valid excuse to rename it because it does not cover the ref\n> database and config database and others.\n\nI wouldn't mind that outcome much, either. What triggered this series is\nthat I'm always annoyed that it's \"builtin/init-db.c\" instead of\n\"builtin/init.c\", and the same for `cmd_init_db()`. But I intentionally\nconstructed the series in a way that the first commit can be picked\nas-is, so that we can adjust our code to the modern world while not\ndoing the deprecation dance.\n\nSo I'd be equally happy if we just drop the second commit in this\nseries.\n\nPatrick\n"},{"id":"544464","messageId":"455fc75a-444f-4760-a22f-54a2ec29618b@app.fastmail.com","threadId":"65724","inReplyTo":"ah58IJ8DgSZYRjMM@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-06-02T07:54:02Z","receivedAt":"2026-06-02T07:54:24Z","isPatch":true,"body":"On Tue, Jun 2, 2026, at 08:45, Patrick Steinhardt wrote:\n> On Tue, Jun 02, 2026 at 07:22:50AM +0900, Junio C Hamano wrote:\n>> \"Kristoffer Haugsbakk\" <kristofferhaugsbakk@fastmail.com> writes:\n>>>[snip]\n>> Or just leave it without deprecation.  It does not cost much to keep\n>> \"init-db\", and because we expanded what \"git database\" means in\n>> later versions of Git since its invention, the name still makes\n>> sense.  Thank Linus for not naming it \"init-odb\"---that might have\n>> been a valid excuse to rename it because it does not cover the ref\n>> database and config database and others.\n>\n> I wouldn't mind that outcome much, either. What triggered this series is\n> that I'm always annoyed that it's \"builtin/init-db.c\" instead of\n> \"builtin/init.c\", and the same for `cmd_init_db()`. But I intentionally\n> constructed the series in a way that the first commit can be picked\n> as-is, so that we can adjust our code to the modern world while not\n> doing the deprecation dance.\n>\n> So I'd be equally happy if we just drop the second commit in this\n> series.\n\nCould it be worthwhile to mark it as soft deprecated? In the sense that\nit is a legacy alias that is not planned for removal?\n\nWhat I think was mistake in topic jc/you-still-use-whatchanged was that\ngit-whatchanged(1) was not explicitly marked as deprecated before that\nseries, and then it started failing without a new `--i-still-use-this`\nflag. The doc before that said:\n\n    New users are encouraged to use git-log(1) instead.  The\n    `whatchanged` command is essentially the same as git-log(1) but\n    defaults to showing the raw format diff output and skipping merges.\n\n    The command is primarily kept for historical reasons; fingers of\n    many people who learned Git long before `git log` was invented by\n    reading the Linux kernel mailing list are trained to type it.\n\nReading between the lines, this looks like a soft deprecation. Then\nthere were emails that said that there was no prior warning. And then\nsomeone replied to that saying that it had really been deprecated for\nover a decade because that was the intent.[1] But IMO just saying\nsomething to the effect of soft deprecated would have been better\n(before it got hard deprecated).\n\nTrying to simulate amnesia, I think just the word “init-db” looks\nslightly legacy, and the fact that the documentation just links to\ngit-init(1) solidifies that. On the other hand git-stage(1) was\nintroduced as a better name for “staging” files and that too just links\nto git-add(1). So you have two commands which just link to other\ncommands, but one is definitely more deprecated than the other.\n\n† 1: But “trained fingers” reading the man page every other year on the\n     off chance that there are new developments? That’s another\n     question.\n"},{"id":"544470","messageId":"xmqqv7c1xs76.fsf@gitster.g","threadId":"65724","inReplyTo":"ah58IJ8DgSZYRjMM@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-06-02T08:27:41Z","receivedAt":"2026-06-02T08:27:44Z","isPatch":true,"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> I wouldn't mind that outcome much, either. What triggered this series is\n> that I'm always annoyed that it's \"builtin/init-db.c\" instead of\n> \"builtin/init.c\", and the same for `cmd_init_db()`. But I intentionally\n> constructed the series in a way that the first commit can be picked\n> as-is, so that we can adjust our code to the modern world while not\n> doing the deprecation dance.\n>\n> So I'd be equally happy if we just drop the second commit in this\n> series.\n\nI'd actually find myself annoyed by such a rename when looking for\nbuiltin/init-db.c only to find it gone---much like how a previous\nrename made ll-merge difficult to locate.\n\nMy point is that while static names may annoy some, renaming them\ndoes not resolve the annoyance; it merely shifts it to someone else.\n\nSo, if the primary motivation is just the first patch, I would be\nless inclined to support this series.\n"},{"id":"544499","messageId":"ah7N4CeYM4rozerD@pks.im","threadId":"65724","inReplyTo":"455fc75a-444f-4760-a22f-54a2ec29618b@app.fastmail.com","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-02T12:34:40Z","receivedAt":"2026-06-02T12:34:47Z","isPatch":true,"body":"On Tue, Jun 02, 2026 at 09:54:02AM +0200, Kristoffer Haugsbakk wrote:\n> On Tue, Jun 2, 2026, at 08:45, Patrick Steinhardt wrote:\n> > On Tue, Jun 02, 2026 at 07:22:50AM +0900, Junio C Hamano wrote:\n> >> \"Kristoffer Haugsbakk\" <kristofferhaugsbakk@fastmail.com> writes:\n> >>>[snip]\n> >> Or just leave it without deprecation.  It does not cost much to keep\n> >> \"init-db\", and because we expanded what \"git database\" means in\n> >> later versions of Git since its invention, the name still makes\n> >> sense.  Thank Linus for not naming it \"init-odb\"---that might have\n> >> been a valid excuse to rename it because it does not cover the ref\n> >> database and config database and others.\n> >\n> > I wouldn't mind that outcome much, either. What triggered this series is\n> > that I'm always annoyed that it's \"builtin/init-db.c\" instead of\n> > \"builtin/init.c\", and the same for `cmd_init_db()`. But I intentionally\n> > constructed the series in a way that the first commit can be picked\n> > as-is, so that we can adjust our code to the modern world while not\n> > doing the deprecation dance.\n> >\n> > So I'd be equally happy if we just drop the second commit in this\n> > series.\n> \n> Could it be worthwhile to mark it as soft deprecated? In the sense that\n> it is a legacy alias that is not planned for removal?\n\nThe question is how such a soft deprecation would look like. Would it be\na warning, only, but other than that it behaves just as before? Should\nwe mark it as `DEPRECATED` in \"git.c\"? Both of those?\n\nPatrick\n"},{"id":"544500","messageId":"ah7N5bKAiAORtNkp@pks.im","threadId":"65724","inReplyTo":"xmqqv7c1xs76.fsf@gitster.g","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-02T12:34:45Z","receivedAt":"2026-06-02T12:34:50Z","isPatch":true,"body":"On Tue, Jun 02, 2026 at 05:27:41PM +0900, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > I wouldn't mind that outcome much, either. What triggered this series is\n> > that I'm always annoyed that it's \"builtin/init-db.c\" instead of\n> > \"builtin/init.c\", and the same for `cmd_init_db()`. But I intentionally\n> > constructed the series in a way that the first commit can be picked\n> > as-is, so that we can adjust our code to the modern world while not\n> > doing the deprecation dance.\n> >\n> > So I'd be equally happy if we just drop the second commit in this\n> > series.\n> \n> I'd actually find myself annoyed by such a rename when looking for\n> builtin/init-db.c only to find it gone---much like how a previous\n> rename made ll-merge difficult to locate.\n> \n> My point is that while static names may annoy some, renaming them\n> does not resolve the annoyance; it merely shifts it to someone else.\n> \n> So, if the primary motivation is just the first patch, I would be\n> less inclined to support this series.\n\nThat's entirely fair. My take on this is a bit different, as I think\nit's beneficial to accept a short-term adjustment for core contributors\nin favor of making stuff easier to discover/maintain going forward.\n\nA new contributor would probably be quick to learn that every\n`cmd_foo()` entry point is named exactly the same as the subcommand\nname, but they will then eventually trip over the few exceptions like\n`cmd_init_db()` where that assumption doesn't hold.\n\nBut I can see that this is not always clear-cut.\n\nPatrick\n"},{"id":"544504","messageId":"336a4202-a55f-4223-b654-985d47233653@gmail.com","threadId":"65724","inReplyTo":"ah2VL-ftCQelNoOc@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-06-02T13:09:39Z","receivedAt":"2026-06-02T13:09:44Z","isPatch":true,"body":"Hi Patrick\n\nOn 01/06/2026 15:20, Patrick Steinhardt wrote:\n> On Mon, Jun 01, 2026 at 02:48:05PM +0100, Phillip Wood wrote:\n>>\n>>\n>> On 01/06/2026 13:10, Patrick Steinhardt wrote:\n>>> On Mon, Jun 01, 2026 at 11:31:46AM +0200, Kristoffer Haugsbakk wrote:\n>>>> On Mon, Jun 1, 2026, at 09:56, Patrick Steinhardt wrote:\n>>>>> diff --git a/git.c b/git.c\n>>>>> index a72394b599..6bf6a60360 100644\n>>>>> --- a/git.c\n>>>>> +++ b/git.c\n>>>>> @@ -591,7 +591,9 @@ static struct cmd_struct commands[] = {\n>>>>>    \t{ \"hook\", cmd_hook, RUN_SETUP_GENTLY },\n>>>>>    \t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY | NO_PARSEOPT },\n>>>>>    \t{ \"init\", cmd_init },\n>>>>> +#ifndef WITH_BREAKING_CHANGES\n>>>>>    \t{ \"init-db\", cmd_init },\n>>>>\n>>>> This can be marked as deprecated.\n>>>>\n>>>> \t{ \"init-db\", cmd_init, DEPRECATED },\n>>>\n>>> Ah, indeed! Added locally now, thanks.\n>>\n>> Deprecating this command seems very sensible to me. As well as marking it\n>> deprecated, do we want to print a warning when it is run? I imagine anyone\n>> who has this command in their muscle memory is unlikely to be reading the\n>> man page on a regular basis so wont see the warning there.\n> \n> I was wondering whether we want to call `you_still_use_that()` here. I\n> found it to be a bit heavy-handed as it's so trivial to replace with\n> git-init(1), but on the other hand it's a trivial thing to do.\n\nI agree you_still_use_that() is too heavy handed, I was thinking of \nsomething like\n\n\twarning(_(\"this command is deprecated, please use \\\"git init\\\"\"\n\t\t  \"instead\");\n\nbut that would mean we need to add a separate cmd_init_db() function \nthat prints the warning and then calls cmd_init().\n\nThanks\n\nPhillip\n\n"},{"id":"544505","messageId":"e6e225e7-f915-4ed0-900d-03a7767fb36f@gmail.com","threadId":"65724","inReplyTo":"ah7N5bKAiAORtNkp@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-06-02T13:12:58Z","receivedAt":"2026-06-02T13:13:04Z","isPatch":true,"body":"On 02/06/2026 13:34, Patrick Steinhardt wrote:\n> \n> That's entirely fair. My take on this is a bit different, as I think\n> it's beneficial to accept a short-term adjustment for core contributors\n> in favor of making stuff easier to discover/maintain going forward.\n> > A new contributor would probably be quick to learn that every\n> `cmd_foo()` entry point is named exactly the same as the subcommand\n> name, but they will then eventually trip over the few exceptions like\n> `cmd_init_db()` where that assumption doesn't hold.\n\nYes, those exceptions to the rule are annoying. Though they mostly exist \nfor a good reason (code sharing between builtin commands), it would be \nnice to minimize them where we can.\n\nThanks\n\nPhillip\n\n"},{"id":"544514","messageId":"xmqq5x41vypg.fsf@gitster.g","threadId":"65724","inReplyTo":"336a4202-a55f-4223-b654-985d47233653@gmail.com","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-06-02T13:50:03Z","receivedAt":"2026-06-02T13:50:09Z","isPatch":true,"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n>> I was wondering whether we want to call `you_still_use_that()` here. I\n>> found it to be a bit heavy-handed as it's so trivial to replace with\n>> git-init(1), but on the other hand it's a trivial thing to do.\n>\n> I agree you_still_use_that() is too heavy handed, I was thinking of \n> something like\n>\n> \twarning(_(\"this command is deprecated, please use \\\"git init\\\"\"\n> \t\t  \"instead\");\n>\n> but that would mean we need to add a separate cmd_init_db() function \n> that prints the warning and then calls cmd_init().\n\nIf we do plan to remove it in the future, then something like that\nmay be needed.\n\nBut it is not like having \"init-db\" hidden but accessible in the\ncommand table is hurting anything.  Other than that those who want\nto create their own\n\n    [alias \"init-db\"] command = foo\n\nthat is, and I'd see it a bit crazy.\n\nThe \"init-db\" form is hidden from \"git help\" listing, and we know\nwhenever we suggest to run \"git init\" we do not say \"git init-db\",\nso if we do not have to remove it in the future, I do not think we\neven need such a warning().\n\n"},{"id":"544526","messageId":"ah7vnZn72jhfmV3T@pks.im","threadId":"65724","inReplyTo":"e6e225e7-f915-4ed0-900d-03a7767fb36f@gmail.com","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-02T14:58:37Z","receivedAt":"2026-06-02T14:58:43Z","isPatch":true,"body":"On Tue, Jun 02, 2026 at 02:12:58PM +0100, Phillip Wood wrote:\n> On 02/06/2026 13:34, Patrick Steinhardt wrote:\n> > \n> > That's entirely fair. My take on this is a bit different, as I think\n> > it's beneficial to accept a short-term adjustment for core contributors\n> > in favor of making stuff easier to discover/maintain going forward.\n> > > A new contributor would probably be quick to learn that every\n> > `cmd_foo()` entry point is named exactly the same as the subcommand\n> > name, but they will then eventually trip over the few exceptions like\n> > `cmd_init_db()` where that assumption doesn't hold.\n> \n> Yes, those exceptions to the rule are annoying. Though they mostly exist for\n> a good reason (code sharing between builtin commands), it would be nice to\n> minimize them where we can.\n\nEither minimize, or if we don't want to (or can't) the next best thing\nis to pick the variant that most folks will know about. Which would be\nthe case if we just picked the first patch in this series.\n\nPatrick\n"},{"id":"544528","messageId":"ah71u8f8L/uN7O1Q@szeder.dev","threadId":"65724","inReplyTo":"ah7N5bKAiAORtNkp@pks.im","subject":"Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2026-06-02T15:24:43Z","receivedAt":"2026-06-02T15:24:46Z","isPatch":true,"body":"On Tue, Jun 02, 2026 at 02:34:45PM +0200, Patrick Steinhardt wrote:\n> On Tue, Jun 02, 2026 at 05:27:41PM +0900, Junio C Hamano wrote:\n> > Patrick Steinhardt <ps@pks.im> writes:\n> > \n> > > I wouldn't mind that outcome much, either. What triggered this series is\n> > > that I'm always annoyed that it's \"builtin/init-db.c\" instead of\n> > > \"builtin/init.c\", and the same for `cmd_init_db()`. But I intentionally\n> > > constructed the series in a way that the first commit can be picked\n> > > as-is, so that we can adjust our code to the modern world while not\n> > > doing the deprecation dance.\n> > >\n> > > So I'd be equally happy if we just drop the second commit in this\n> > > series.\n> > \n> > I'd actually find myself annoyed by such a rename when looking for\n> > builtin/init-db.c only to find it gone---much like how a previous\n> > rename made ll-merge difficult to locate.\n> > \n> > My point is that while static names may annoy some, renaming them\n> > does not resolve the annoyance; it merely shifts it to someone else.\n> > \n> > So, if the primary motivation is just the first patch, I would be\n> > less inclined to support this series.\n> \n> That's entirely fair. My take on this is a bit different, as I think\n> it's beneficial to accept a short-term adjustment for core contributors\n> in favor of making stuff easier to discover/maintain going forward.\n\nThat's not a short-term adjustment, but it will be an ongoing\nannoyance, because 'git log builtin/init.c' will cut off at the rename\nbarrier.\n\n"}]}