git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Beat Bolli" <bb@drbeat.li>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
	Beat Bolli <dev+git@drbeat.li>
Subject: [PATCH v2 0/3] color: add support for 12-bit RGB colors
Date: Thu,  2 May 2024 13:03:28 +0200	[thread overview]
Message-ID: <20240502110331.6347-1-dev+git@drbeat.li> (raw)
In-Reply-To: <20240429164849.78509-1-dev+git@drbeat.li>

 * The color parsing code learned to handle 12-bit RGB colors.

The first commit fixes a typo, the second one adds some test coverage
for invalid RGB colors, and the final one extends the RGB color parser
to recognize 12-bit colors, as in #f0f.
---

Changes against v1:
- add test coverage for invalid RGB color lengths

1:  25da18f71e2c = 1:  25da18f71e2c t/t4026-color: remove an extra double quote character
2:  fb9a6ed05279 ! 2:  352fa4c91aa0 t/t4026-color: add test coverage for invalid RGB colors
    @@ Metadata
      ## Commit message ##
         t/t4026-color: add test coverage for invalid RGB colors
     
    -    Make sure that the RGB color parser rejects invalid characters.
    +    Make sure that the RGB color parser rejects invalid characters and
    +    invalid lengths.
     
      ## t/t4026-color.sh ##
     @@ t/t4026-color.sh: test_expect_success 'extra character after attribute' '
    @@ t/t4026-color.sh: test_expect_success 'extra character after attribute' '
     +	invalid_color "#1234x6" &&
     +	invalid_color "#12345x"
     +'
    ++
    ++test_expect_success 'wrong number of letters in RGB color' '
    ++	invalid_color "#1" &&
    ++	invalid_color "#23" &&
    ++	invalid_color "#456" &&
    ++	invalid_color "#789a" &&
    ++	invalid_color "#bcdef" &&
    ++	invalid_color "#1234567"
    ++'
     +
      test_expect_success 'unknown color slots are ignored (diff)' '
      	git config color.diff.nosuchslotwilleverbedefined white &&
3:  9d109fadcdb1 ! 3:  9147902f698f color: add support for 12-bit RGB colors
    @@ t/t4026-color.sh: test_expect_success 'non-hex character in RGB color' '
     +	invalid_color "#12x"
      '
      
    - test_expect_success 'unknown color slots are ignored (diff)' '
    + test_expect_success 'wrong number of letters in RGB color' '
    + 	invalid_color "#1" &&
    + 	invalid_color "#23" &&
    +-	invalid_color "#456" &&
    + 	invalid_color "#789a" &&
    + 	invalid_color "#bcdef" &&
    + 	invalid_color "#1234567"


Beat Bolli (3):
  t/t4026-color: remove an extra double quote character
  t/t4026-color: add test coverage for invalid RGB colors
  color: add support for 12-bit RGB colors

 Documentation/config.txt |  3 ++-
 color.c                  | 21 ++++++++++++++-------
 color.h                  |  3 ++-
 t/t4026-color.sh         | 26 +++++++++++++++++++++++---
 4 files changed, 41 insertions(+), 12 deletions(-)

-- 
2.44.0


  parent reply	other threads:[~2024-05-02 11:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 16:48 [PATCH 0/3] color: add support for 12-bit RGB colors Beat Bolli
2024-04-29 16:48 ` [PATCH 1/3] t/t4026-color: remove an extra double quote character Beat Bolli
2024-04-30 10:59   ` Jeff King
2024-04-29 16:48 ` [PATCH 2/3] t/t4026-color: add test coverage for invalid RGB colors Beat Bolli
2024-04-29 16:48 ` [PATCH 3/3] color: add support for 12-bit " Beat Bolli
2024-04-29 17:23   ` Junio C Hamano
2024-04-29 17:42     ` Beat Bolli
2024-04-30 10:57   ` Jeff King
2024-04-30 17:31     ` Junio C Hamano
2024-04-30 18:41       ` Junio C Hamano
2024-04-30 19:01         ` Junio C Hamano
2024-05-03 17:47           ` Jeff King
2024-04-29 21:37 ` [PATCH 0/3] " Taylor Blau
2024-05-02 11:03 ` Beat Bolli [this message]
2024-05-02 11:03   ` [PATCH v2 1/3] t/t4026-color: remove an extra double quote character Beat Bolli
2024-05-02 11:03   ` [PATCH v2 2/3] t/t4026-color: add test coverage for invalid RGB colors Beat Bolli
2024-05-02 11:03   ` [PATCH v2 3/3] color: add support for 12-bit " Beat Bolli
2024-05-02 16:29   ` [PATCH v2 0/3] " Junio C Hamano
2024-05-03 17:48   ` Jeff King
2024-05-03 19:31     ` Beat Bolli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240502110331.6347-1-dev+git@drbeat.li \
    --to=bb@drbeat.li \
    --cc=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).