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

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

From
Derrick Stolee <derrickstolee@github.com>
Date
Jun 7, 2023, 13:33 UTC
Message-ID
<4b0e8026-4372-67ea-356c-b8073a6da20e@github.com>
In-Reply-To
<a76a91a0-cefe-807f-f1f6-4a277d724630@gmail.com>
On 6/7/2023 7:09 AM, Phillip Wood wrote:
Show 28 quoted lines
> On 06/06/2023 15:20, Derrick Stolee via GitGitGadget wrote:
>> From: Derrick Stolee <derrickstolee@github.com>
>>
>>       -+    *** Commands ***
>>       -+      1: [s]tatus      2: [u]pdate      3: [r]evert      4: [a]dd untracked
>>       -+      5: [p]atch      6: [d]iff      7: [q]uit      8: [h]elp
>>       -+    What now> status        - show paths with changes
>>       -+    update        - add working tree state to the staged set of changes
>>       -+    revert        - revert staged set of changes back to the HEAD version
>>       -+    patch         - pick hunks and update selectively
>>       -+    diff          - view diff between HEAD and index
>>       -+    add untracked - add contents of untracked files to the staged set of changes
>>       -+    *** Commands ***
>>       -+      1: [s]tatus      2: [u]pdate      3: [r]evert      4: [a]dd untracked
>>       -+      5: [p]atch      6: [d]iff      7: [q]uit      8: [h]elp
>>       -+    What now> Bye.
>>       -+    EOF
>>       -+    test_cmp expect actual
>>       ++    test_cmp actual.raw actual
>>        +'
> 
> I know Junio suggested this change, but I'm in two minds as to whether
> it is a good idea. The reason is that we're no-longer testing that we
> add "[]" around the text that would have been highlighted if color was
> enabled. That is with --color we print "1: status" with the "s" highlighted
> rather than "1: [s]tatus". So while the revised patch tests there is no
> color in the output, it does not test that we print the output correctly
> in that case.

This is a good point, and something that I somewhat expected to find as an example check in the rest of the test script. I think the color would be disabled if we didn't do force_color, even before this fix.

However, I'll double-check that by adding a separate test for just that bit of the UI, keeping this color.ui=false test focused on the color side of things.

Thanks, -Stolee

Previous: Phillip WoodNext: Junio C Hamano
Message 8 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.