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

Re: [RFC/PATCH] graph API: Added logic for colored edges.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 31, 2009, 10:13 UTC
Message-ID
<alpine.DEB.1.00.0903311210000.10279@pacific.mpi-cbg.de>
In-Reply-To
<20090330141322.GA6221@linux.vnet>
Hi,
On Mon, 30 Mar 2009, Allan Caffee wrote:
Show 8 quoted lines
> +static void strbuf_write_column(struct strbuf *sb, const struct column *c,
> +		const char *s)
> +{
> +	/*
> +	 * TODO: I get the creeping suspicion that this isn't the
> +	 * right flag to be checking since --no-color doesn't turn
> +	 * this off.
> +	 */
Heh, of course I forgot to remove this with my to-be-squashed-in patch...
Show 6 quoted lines
> +	if (diff_use_color_default)
> +		strbuf_addstr(sb, c->color);
> +	strbuf_addstr(sb, s);
> +	if (diff_use_color_default)
> +		strbuf_addstr(sb, GIT_COLOR_RESET);
> +}
How about this function instead?
static void strbuf_add_column(struct strbuf *sb,
	const struct column *column, const char *fmt, ...)
{
        va_list ap;
        va_start(ap, fmt);
	if (column->color)
		strbuf_addstr(sb, column->color);
        strbuf_vaddf(sb, fmt, ap);
	if (column->color)
		strbuf_addstr(sb, GIT_COLOR_RESET);
        va_end(ap);
}
Hmm?

Ciao, Dscho

Previous: Johannes SchindelinNext: Johannes Sixt
Message 17 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.