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

Re: [RFC PATCH] show decorations at the end of the line

From
Jeff King <peff@peff.net>
Date
Feb 13, 2017, 22:38 UTC
Message-ID
<20170213223819.gr3wndswieu4bbvn@sigill.intra.peff.net>
In-Reply-To
<xmqq7f4tdcua.fsf@gitster.mtv.corp.google.com>
On Mon, Feb 13, 2017 at 01:01:49PM -0800, Junio C Hamano wrote:
Show 11 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
> 
> > And if you actually want decorations, and you're parsing them, you are
> > *not* going to script it with "--oneline --decorations", because the
> > end result is basically impossible to parse already (because it's
> > ambiguous - think about parentheses in the commit message).
> 
> OK.  So let's wait to hear from others if they like the "obviously"
> improved output.  Even though I find the decorations indispensable
> in my "git log" output, I personally do not have much preference
> either way, as my screen is often wide enough ;-)

I have a slight preference for the new output (decorations at the end) versus the original, but I could go either way.

I don't think the scripting compatibility concerns are an issue, for all the reasons given in the thread.

There is one related option, --source, which also puts its data between the hash and the subject in --oneline. In theory that should be treated similarly, though:

  1. It's already really ugly, as it does not even get the parentheses
     and coloring.
  2. It's perhaps more likely to get scripted, as it really is parseable
     in the current state.

I'm not sure if a better path forward would be to just extend the idea of "decorator" to possibly include more than just ref-tips. On the other hand, if you really want to get fancy with formatting, we already have a complete formatting language. Perhaps it should learn a placeholder for the "--source" data.

Similarly, I've often wanted a "contained in this tags/branches" annotation for each commit. It's not too expensive to compute if you topo-sort the set of commits and just paint down as you traverse.

Anyway, I think none of that needs to block changes to --decorate output. Just thinking out loud.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 20 in “show decorations at the end of the line”
  1. show decorations at the end of the lineLinus Torvalds, Feb 11, 2017
  2. Linus TorvaldsFeb 11, 2017
  3. Junio C HamanoFeb 13, 2017
  4. Linus TorvaldsFeb 13, 2017
  5. Junio C HamanoFeb 13, 2017
  6. Jeff KingFeb 13, 2017
  7. Junio C HamanoFeb 14, 2017
  8. Jeff KingFeb 15, 2017
  9. Junio C HamanoFeb 18, 2017
  10. Linus TorvaldsFeb 19, 2017
  11. Jacob KellerFeb 19, 2017
  12. Jeff KingFeb 20, 2017
  13. Junio C HamanoFeb 20, 2017
  14. Linus TorvaldsFeb 20, 2017
  15. Junio C HamanoFeb 21, 2017
  16. Linus TorvaldsFeb 21, 2017
  17. Jeff KingFeb 21, 2017
  18. Junio C HamanoFeb 21, 2017
  19. Jeff KingFeb 21, 2017
  20. Stephan BeyerFeb 14, 2017

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.