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

Re: [PATCH v3] graph API: Added logic for colored edges

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 12, 2009, 18:45 UTC
Message-ID
<7vk55p7lu3.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<b2e43f8f0904121043o425ac311ib32c18625fac2c0e@mail.gmail.com>
Allan Caffee <allan.caffee@gmail.com> writes:
Show 6 quoted lines
>> > +const unsigned short GIT_NOT_A_COLOR = -1;
>>
>> That (-1) is an unusual value for an *unsigned* short variable.
>
> Perhaps you would prefer USHRT_MAX?  I noticed that none of the existing
> code #includes limits.h.  Is it safe to assume this header is present?
I expected to see something like 
	#define COLUMN_COLORS_MAX (ARRAY_SIZE(column_colors)+1)
	write_with_color(...) {
                if (c->color < COLUMN_COLORS_MAX)
                        add color prefix;
                add string
                if (c->color < COLUMN_COLORS_MAX)
                        add color suffix;
	}
instead, actually, and was a bit surprised with (-1).
Previous: Allan CaffeeNext: Allan Caffee
Message 8 of 13 in “graph API: Added logic for colored edges”
  1. graph API: Added logic for colored edgesAllan Caffee, Apr 7, 2009
  2. Junio C HamanoApr 8, 2009
  3. Allan CaffeeApr 8, 2009
  4. Junio C HamanoApr 9, 2009
  5. graph API: Added logic for colored edgesAllan Caffee, Apr 9, 2009
  6. Junio C HamanoApr 12, 2009
  7. Allan CaffeeApr 12, 2009
  8. Junio C HamanoApr 12, 2009
  9. graph API: Added logic for colored edgesAllan Caffee, Apr 12, 2009
  10. Junio C HamanoApr 12, 2009
  11. graph API: Added logic for colored edgesAllan Caffee, Apr 13, 2009
  12. Teemu LikonenApr 9, 2009
  13. Allan CaffeeApr 9, 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.