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

Re: [PATCH] add: check color.ui for interactive add

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 6, 2023, 01:05 UTC
Message-ID
<xmqqo7lt4cyy.fsf@gitster.g>
In-Reply-To
<xmqqsfb54d4u.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 24 quoted lines
>> +	test_decode_color <actual.raw >actual &&
>
> It is a minor thing, but for expected output that _wants_ to be
> indented in a non-standard way, it would be prudent to protect the
> lines from "git apply --whitespace=fix" and in-transit corruption,
> perhaps doing something like ...
>
>> +	cat >expect <<-\EOF &&
>> +	           staged     unstaged path
>> +	  1:        +3/-0        +2/-1 color-test
>> +
>> +	*** Commands ***
>
> ... this.
>
> 	sed -e "s/^|//" >expect <<-\EOF &&
> 	|           staged     unstaged path
> 	|  1:        +3/-0        +2/-1 color-test
> 	|
> 	|*** Commands ***
>
> Although this patch does not add such lines, the same principle
> applies to expected output lines that _wants_ to have trailing
> whitespaces.

Another thing. We are interested in the configuration to disable color, so instead of spelling out exact output we expect, which is brittle when we anticipate that the contents used for the test may change, wouldn't it work better to ensure that actual.raw and actual are identical?

Previous: Junio C HamanoNext: Jeff King
Message 3 of 12 in “add: check color.ui for interactive add”
  1. add: check color.ui for interactive addDerrick Stolee via GitGitGadget, Jun 5, 2023
  2. Junio C HamanoJun 6, 2023
  3. Junio C HamanoJun 6, 2023
  4. Jeff KingJun 6, 2023
  5. Derrick StoleeJun 6, 2023
  6. add: check color.ui for interactive addDerrick Stolee via GitGitGadget, Jun 6, 2023
  7. Phillip WoodJun 7, 2023
  8. Derrick StoleeJun 7, 2023
  9. Junio C HamanoJun 12, 2023
  10. 2/2 add: test use of brackets when color is disabledDerrick Stolee, Jun 7, 2023
  11. Phillip WoodJun 7, 2023
  12. Junio C HamanoJun 12, 2023

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.