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

[PATCH 0/1] Colorize some errors on stderr

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 16, 2018, 12:25 UTC
Message-ID
<cover.1518783709.git.johannes.schindelin@gmx.de>

This is an RFC because it tries to introduce a fundamental new color feature: Coloring messages *on stderr*.

So far, pretty much everything in color.[ch] assumed that you want to color only stuff on stdout.

However, in this case, a user (who became a contributor!) wanted some messages that are printed to stderr and were missed by his colleagues to be colored.

The contribution comes via Pull Request from the Git for Windows project:
	https://github.com/git-for-windows/git/pull/1429
Now, what would be possible solutions for this?
- introduce `int fd` in `want_color()` (and callees) so that we can make
  a distinction whether we want to detect whether stdout or stderr is connected
  to a tty
- introduce a separate `want_color_stderr()` (we still would need to decide
  whether we want a config setting for this)
- not color stderr, ever

Also, I did not have too much time to dig into the question how to test this in Git's test suite. Do we already have tests that generate fake server-side errors onto which I could piggy-back a new test case?

Thoughts? Suggestions? Help?
Ryan Dammrose (1):
  Colorize push errors
 advice.c       | 42 +++++++++++++++++++++++++++++++++++++++--
 builtin/push.c | 38 +++++++++++++++++++++++++++++++++++++
 transport.c    | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 136 insertions(+), 3 deletions(-)
base-commit: b2e45c695d09f6a31ce09347ae0a5d2cdfe9dd4e
Published-As: https://github.com/dscho/git/releases/tag/colorize-push-errors-v1
Fetch-It-Via: git fetch https://github.com/dscho/git colorize-push-errors-v1
-- 
2.16.1.windows.4
Next: Johannes Schindelin
Message 1 of 22 in “Colorize some errors on stderr”
  1. 0/1 Colorize some errors on stderrJohannes Schindelin, Feb 16, 2018
  2. 1/1 Colorize push errorsJohannes Schindelin, Feb 16, 2018
  3. Junio C HamanoFeb 16, 2018
  4. Johannes SchindelinApr 6, 2018
  5. 0/4 Colorize push errorsJohannes Schindelin, Apr 5, 2018
  6. 1/4 color: introduce support for colorizing stderrJohannes Schindelin, Apr 5, 2018
  7. 2/4 push: colorize errorsJohannes Schindelin, Apr 5, 2018
  8. Jacob KellerApr 5, 2018
  9. Johannes SchindelinApr 6, 2018
  10. 3/4 Add a test to verify that push errors are colorfulJohannes Schindelin, Apr 5, 2018
  11. Eric SunshineApr 6, 2018
  12. Johannes SchindelinApr 6, 2018
  13. 4/4 Document the new color.* settings to colorize push errors/hintsJohannes Schindelin, Apr 5, 2018
  14. Eric SunshineApr 6, 2018
  15. Johannes SchindelinApr 6, 2018
  16. Eric SunshineApr 7, 2018
  17. 0/4 Colorize push errorsJohannes Schindelin, Apr 21, 2018
  18. 1/4 color: introduce support for colorizing stderrJohannes Schindelin, Apr 21, 2018
  19. 2/4 push: colorize errorsJohannes Schindelin, Apr 21, 2018
  20. 3/4 Add a test to verify that push errors are colorfulJohannes Schindelin, Apr 21, 2018
  21. 4/4 Document the new color.* settings to colorize push errors/hintsJohannes Schindelin, Apr 21, 2018
  22. Ævar Arnfjörð BjarmasonApr 6, 2018

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.