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

Re: [PATCH v3 3/8] wt-status: move wt_status_colors[] into wt_status structure

From
Jeff King <peff@peff.net>
Date
Aug 10, 2009, 09:12 UTC
Message-ID
<20090810091250.GB7513@coredump.intra.peff.net>
In-Reply-To
<1249894465-11018-4-git-send-email-gitster@pobox.com>
On Mon, Aug 10, 2009 at 01:54:20AM -0700, Junio C Hamano wrote:
Show 5 quoted lines
> @@ -37,6 +38,7 @@ struct wt_status {
>  	int wt_status_relative_paths;
>  	int wt_status_submodule_summary;
>  	enum untracked_status_type show_untracked_files;
> +	char wt_status_colors[6][COLOR_MAXLEN];
Yuck on the magic "6". It should be safe to use
  ARRAY_SIZE(wt_status_colors_default)

since that is computed purely from sizeof's. Though I am not discounting the possibility that there are compilers which will screw it up.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 10 of 11 in “shortstatus updates”
  1. 0/8 shortstatus updatesJunio C Hamano, Aug 10, 2009
  2. 1/8 commit: --dry-runJunio C Hamano, Aug 10, 2009
  3. 2/8 wt-status: move many global settings to wt_status structureJunio C Hamano, Aug 10, 2009
  4. 3/8 wt-status: move wt_status_colors[] into wt_status structureJunio C Hamano, Aug 10, 2009
  5. 4/8 Make git_status_config() file scope static to builtin-commit.cJunio C Hamano, Aug 10, 2009
  6. 5/8 wt-status: collect untracked files in a separate "collect" phaseJunio C Hamano, Aug 10, 2009
  7. 6/8 git stat: the beginningJunio C Hamano, Aug 10, 2009
  8. 7/8 git stat: pathspec limits, unlike traditional "git status"Junio C Hamano, Aug 10, 2009
  9. 8/8 git stat -s: short status outputJunio C Hamano, Aug 10, 2009
  10. Jeff KingAug 10, 2009
  11. Jeff KingAug 10, 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.