Re: [PATCH] branch: issue "-l" deprecation warning after pager starts
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 25, 2018, 01:55 UTC
- Message-ID
- <xmqqh8mwpkgu.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180524193105.GB21535@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Hmm, actually, I suppose the true value of the warning is to help people > doing "git branch -l foo", and it would still work there. The "more > extreme" from your suggested patch would only affect "branch -l".
> Still, I think I prefer the gentler version that we get by keeping it as > a warning even in the latter case.
"git branch -l newbranch [forkpoint]" that warns "We won't be doing reflog creation with -l" is good, but "git branch -l" that warns "We won't be doing reflog creation with -l" sounds like a pure noise, as the user would say "Irrelevant, I am not doing that anyway--I am listing".
The warning to prepare users for the next step jk/branch-l-1-removal should say "we won't be accepting '-l' as a silent and unadvertised synonym soon. Spell it as --list" when "git branch -l" is given, I would think.
Show 8 quoted lines
> @@ -700,6 +700,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
> if (list)
> 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");
> + }So from that point of view, we may need a separate message to warn users who _do_ want listing with '-l' before jk/branch-l-1-removal removes it?
The jk/branch-l-2-resurrection topic later repurposes '-l' for '--list' but until that happens 'git branch -l' will error not, no?