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

Re: [PATCH 1/2] Clean up use of ANSI color sequences

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 14, 2009, 02:02 UTC
Message-ID
<7v4oyx4vxw.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1234562021-2397-1-git-send-email-arjen@yaph.org>
Arjen Laarhoven <arjen@yaph.org> writes:
Show 22 quoted lines
> diff --git a/pretty.c b/pretty.c
> index cc460b5..a8595f6 100644
> --- a/pretty.c
> +++ b/pretty.c
> @@ -567,16 +567,16 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
>  			return end - placeholder + 1;
>  		}
>  		if (!prefixcmp(placeholder + 1, "red")) {
> -			strbuf_addstr(sb, "\033[31m");
> +			strbuf_addstr(sb, COLOR_RED);
>  			return 4;
>  		} else if (!prefixcmp(placeholder + 1, "green")) {
> -			strbuf_addstr(sb, "\033[32m");
> +			strbuf_addstr(sb, COLOR_GREEN);
>  			return 6;
>  		} else if (!prefixcmp(placeholder + 1, "blue")) {
> -			strbuf_addstr(sb, "\033[34m");
> +			strbuf_addstr(sb, COLOR_BLUE);
>  			return 5;
>  		} else if (!prefixcmp(placeholder + 1, "reset")) {
> -			strbuf_addstr(sb, "\033[m");
> +			strbuf_addstr(sb, COLOR_RESET);
These four are obviously bad and not even compile tested.
I'll fix them up when queuing.
Previous: Arjen LaarhovenNext: Arjen Laarhoven
Message 5 of 7 in “Clean up use of ANSI color sequences”
  1. Clean up use of ANSI color sequencesArjen Laarhoven, Feb 12, 2009
  2. Junio C HamanoFeb 12, 2009
  3. 1/2 Clean up use of ANSI color sequencesArjen Laarhoven, Feb 13, 2009
  4. 2/2 builtin-branch.c: Rename branch category color namesArjen Laarhoven, Feb 13, 2009
  5. Junio C HamanoFeb 14, 2009
  6. Arjen LaarhovenFeb 14, 2009
  7. Junio C HamanoFeb 14, 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.