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

Re: [RFC] Colorization of log --graph

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 18, 2009, 11:44 UTC
Message-ID
<alpine.DEB.1.00.0903181228420.10279@pacific.mpi-cbg.de>
In-Reply-To
<20090318100512.GA7932@linux.vnet>
Hi,
On Wed, 18 Mar 2009, Allan Caffee wrote:
Show 5 quoted lines
> I know that _some_ people arn't particularly fond of colors, but I was 
> wondering how difficult it would be to colorize the edges on the --graph 
> drawn by the log command?  It can be a little tricky trying to follow 
> them with a relatively complex history.  I was thinking something like 
> gitk already does.
That's a good idea!  (And it is mentioned as a TODO in graph.c...)
> Is anybody else interested in seeing this?
Count me in.  Are you interested in implementing this?
If so:
- you need to #include "color.h" in graph.c
- you need to insert a color identifier into struct column (there is an 
  XXX comment at the correct location)
- you need to find a way to determine colors for the branches
- you need to put the handling into the function 
  graph_output_pre_commit_line() in graph.c (and probably 
  graph_output_commit_char(), graph_output_post_merge_line(), 
  graph_output_collapsing_line(), graph_padding_line(), and
  graph_output_padding_line(), too)
- it would make sense IMHO to introduce a new function that takes a 
  pointer to an strbuf, a pointer to a struct column and a char (or maybe 
  a string) that adds the appropriately colorized char (or string) to the 
  strbuf
- use the global variable diff_use_color to determine if the output should 
  be colorized at all
- probably you need to make an array of available colors or some such 
  (which might be good to put into color.[ch])

Ciao, Dscho

Previous: Allan CaffeeNext: Allan Caffee
Message 2 of 24 in “[RFC] Colorization of log --graph”
  1. Allan CaffeeMar 18, 2009
  2. Johannes SchindelinMar 18, 2009
  3. Allan CaffeeMar 19, 2009
  4. Johannes SchindelinMar 19, 2009
  5. Nanako ShiraishiMar 19, 2009
  6. Allan CaffeeMar 20, 2009
  7. Jeff KingMar 20, 2009
  8. Junio C HamanoMar 20, 2009
  9. Eric RaibleMar 18, 2009
  10. Santi BéjarMar 18, 2009
  11. Eric RaibleMar 18, 2009
  12. Markus HeidelbergMar 19, 2009
  13. Eric RaibleMar 19, 2009
  14. Markus HeidelbergMar 19, 2009
  15. graph API: Added logic for colored edges.Allan Caffee, Mar 30, 2009
  16. Johannes SchindelinMar 30, 2009
  17. Johannes SchindelinMar 31, 2009
  18. Johannes SixtMar 31, 2009
  19. Johannes SchindelinMar 31, 2009
  20. Johannes SchindelinMar 31, 2009
  21. 1/2 graph.c: avoid compile warningsJohannes Schindelin, Mar 30, 2009
  22. Junio C HamanoMar 30, 2009
  23. Junio C HamanoMar 30, 2009
  24. 2/2 --graph: respect --no-colorJohannes Schindelin, Mar 30, 2009

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.