Re: [PATCH] branch -l: print useful info whilst rebasing a non-local branch
From: Jeff King <hidden>
Date: 2018-03-26 07:25:11
On Sun, Mar 25, 2018 at 12:15:42AM -0700, Jacob Keller wrote:
quoted
3. Drop "-l" (probably with a deprecation period); it seems unlikely to me that anybody uses it for branch creation, and this would at least reduce the confusion (then it would just be "so why don't we have -l" instead of "why is -l not what I expect").Personally, I'd prefer this, because it's minimal effort on scripts part to fix themselves to use the long option name for reflog, and doesn't cause that much heart burn.quoted
4. Repurpose "-l" as a shortcut for --list (also after a deprecation period). This is slightly more dangerous in that it may confuse people using multiple versions of Git that cross the deprecation line. But that's kind of what the deprecation period is for...I don't think this is particularly all that valuable, since we default to list mode so it only helps if you want to pass an argument to the list mode (since otherwise we'd create a branch). Maybe it could be useful, but if we did it, I'd do it as a sort of double deprecation period where we use one period to remove the -l functionality entirely, before adding anything back. I think the *gain* of having -l is not really worth it though.
OK, so here's some patches. We could do the first three now, wait a while before the fourth, and then wait a while (or never) on the fifth. [1/5]: t3200: unset core.logallrefupdates when testing reflog creation [2/5]: t: switch "branch -l" to "branch --create-reflog" [3/5]: branch: deprecate "-l" option [4/5]: branch: drop deprecated "-l" option [5/5]: branch: make "-l" a synonym for "--list" Documentation/git-branch.txt | 3 ++- builtin/branch.c | 4 ++-- t/t1410-reflog.sh | 4 ++-- t/t3200-branch.sh | 34 +++++++++++++++++----------------- 4 files changed, 23 insertions(+), 22 deletions(-) -Peff