Re: [PATCH] Add shell completion for git remote rm
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 17, 2018, 18:20 UTC
- Message-ID
- <xmqqshb4s5y7.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20180117004419.GA14263@duynguyen.dek-tpc.internal>
Duy Nguyen <pclouds@gmail.com> writes:
Show 33 quoted lines
> Looks good. If we want to be more careful, we can follow up with
> something even more annoying like this before removing 'rm'
>
> -- 8< --
> diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
> index 577b969c1b..0a544703e6 100644
> --- a/Documentation/git-remote.txt
> +++ b/Documentation/git-remote.txt
> @@ -90,7 +90,6 @@ In case <old> and <new> are the same, and <old> is a file under
> the configuration file format.
>
> 'remove'::
> -'rm'::
>
> Remove the remote named <name>. All remote-tracking branches and
> configuration settings for the remote are removed.
> diff --git a/builtin/remote.c b/builtin/remote.c
> index d95bf904c3..774ef6931e 100644
> --- a/builtin/remote.c
> +++ b/builtin/remote.c
> @@ -1609,7 +1609,10 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
> result = add(argc, argv);
> else if (!strcmp(argv[0], "rename"))
> result = mv(argc, argv);
> - else if (!strcmp(argv[0], "rm") || !strcmp(argv[0], "remove"))
> + else if (!strcmp(argv[0], "rm")) {
> + warning(_("'rm' is a deprecated synonym. Use 'remove' instead."));
> + result = rm(argc, argv);
> + } else if (!strcmp(argv[0], "remove"))
> result = rm(argc, argv);
> else if (!strcmp(argv[0], "set-head"))
> result = set_head(argc, argv);
> -- 8< --Yes, this is a sensible way to properly deprecate it further before removal.