git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] branch -l: print useful info whilst rebasing a non-local branch

From
Jeff King <peff@peff.net>
Date
Mar 26, 2018, 07:25 UTC
Message-ID
<20180326072505.GA12436@sigill.intra.peff.net>
In-Reply-To
<CA+P7+xr2-OidiX9ve6GwOR4pSOe4Gn=A3Aow5L=oLZgZE+XqMQ@mail.gmail.com>
On Sun, Mar 25, 2018 at 12:15:42AM -0700, Jacob Keller wrote:
Show 22 quoted lines
> >   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.
> 
> >
> >   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
Previous: Jacob KellerNext: Jeff King
Message 10 of 27 in “branch -l: print useful info whilst rebasing a non-local branch”
  1. branch -l: print useful info whilst rebasing a non-local branchKaartic Sivaraam, Mar 24, 2018
  2. Eric SunshineMar 25, 2018
  3. Kaartic SivaraamMar 25, 2018
  4. Jeff KingMar 25, 2018
  5. Eric SunshineMar 25, 2018
  6. Eric SunshineMar 25, 2018
  7. Jeff KingMar 25, 2018
  8. Kaartic SivaraamMar 25, 2018
  9. Jacob KellerMar 25, 2018
  10. Jeff KingMar 26, 2018
  11. 1/5 t3200: unset core.logallrefupdates when testing reflog creationJeff King, Mar 26, 2018
  12. 2/5 t: switch "branch -l" to "branch --create-reflog"Jeff King, Mar 26, 2018
  13. 3/5 branch: deprecate "-l" optionJeff King, Mar 26, 2018
  14. 4/5 branch: drop deprecated "-l" optionJeff King, Mar 26, 2018
  15. 5/5 branch: make "-l" a synonym for "--list"Jeff King, Mar 26, 2018
  16. Eric SunshineMar 26, 2018
  17. Jacob KellerMar 26, 2018
  18. Junio C HamanoMar 25, 2018
  19. Eric SunshineMar 25, 2018
  20. Kaartic SivaraamMar 25, 2018
  21. 1/2 branch --list: print useful info whilst interactive rebasing a detached HEADKaartic Sivaraam, Apr 3, 2018
  22. 2/2 t3200: verify "branch --list" sanity when rebasing from detached HEADKaartic Sivaraam, Apr 3, 2018
  23. Eric SunshineApr 3, 2018
  24. Kaartic SivaraamApr 3, 2018
  25. 2/2 t3200: verify "branch --list" sanity when rebasing from detached HEADKaartic Sivaraam, Apr 3, 2018
  26. Eric SunshineApr 4, 2018
  27. 0/2 branch --list: print useful info whilst interactive rebasing a detached HEADKaartic Sivaraam, Apr 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.