Re: [PATCH 2/2] builtin/init-db: deprecate alias for git-init(1)
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 2, 2026, 13:09 UTC
- Message-ID
- <336a4202-a55f-4223-b654-985d47233653@gmail.com>
- In-Reply-To
- <ah2VL-ftCQelNoOc@pks.im>
Hi Patrick
On 01/06/2026 15:20, Patrick Steinhardt wrote:
Show 31 quoted lines
> On Mon, Jun 01, 2026 at 02:48:05PM +0100, Phillip Wood wrote:
>>
>>
>> On 01/06/2026 13:10, Patrick Steinhardt wrote:
>>> On Mon, Jun 01, 2026 at 11:31:46AM +0200, Kristoffer Haugsbakk wrote:
>>>> On Mon, Jun 1, 2026, at 09:56, Patrick Steinhardt wrote:
>>>>> 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 },
>>>
>>> Ah, indeed! Added locally now, thanks.
>>
>> Deprecating this command seems very sensible to me. As well as marking it
>> deprecated, do we want to print a warning when it is run? I imagine anyone
>> who has this command in their muscle memory is unlikely to be reading the
>> man page on a regular basis so wont see the warning there.
>
> I was wondering whether we want to call `you_still_use_that()` here. I
> found it to be a bit heavy-handed as it's so trivial to replace with
> git-init(1), but on the other hand it's a trivial thing to do.I agree you_still_use_that() is too heavy handed, I was thinking of something like
warning(_("this command is deprecated, please use \"git init\""
"instead");but that would mean we need to add a separate cmd_init_db() function that prints the warning and then calls cmd_init().
Thanks
Phillip