Re: [PATCH] branch: issue "-l" deprecation warning after pager starts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> People mistakenly use "git branch -l", thinking that it
> triggers list mode. It doesn't, but the lack of non-option
> arguments in that command does (and the "-l" becomes a
> silent noop).
>
> Since afc968e579 (branch: deprecate "-l" option, 2018-03-26)
> we've warned that "-l" is going away. But the warning text
> is primarily aimed at people who _meant_ to use "-l", as in
> "git branch -l foo". People who mistakenly said "git branch
> -l" may be left puzzled.

Yup, thanks for being extra explicit.  I do imagine there are quite
a few of us who would be puzzled without this update (but with the
previous one to unhide it from behind the pager).

> Let's make it clear that:
>
>   1. No, "-l" didn't do what they thought here.
>
>   2. It's going away, and what they should do instead.
>
> Signed-off-by: Jeff King <peff@xxxxxxxx>
> ---
>  builtin/branch.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/branch.c b/builtin/branch.c
> index 55bfacd843..b0b33dab94 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -701,8 +701,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
>  		setup_auto_pager("branch", 1);
>  
>  	if (used_deprecated_reflog_option) {
> -		warning("the '-l' alias for '--create-reflog' is deprecated;");
> -		warning("it will be removed in a future version of Git");
> +		if (list) {
> +			warning("the '-l' option is an alias for '--create-reflog' and");
> +			warning("has no effect in list mode. This option will soon be");
> +			warning("removed and you should omit it (or use '--list' instead).");
> +		} else {
> +			warning("the '-l' alias for '--create-reflog' is deprecated;");
> +			warning("it will be removed in a future version of Git");
> +		}
>  	}
>  
>  	if (delete) {



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux