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

[PATCH v3 3/4] Add a test to verify that push errors are colorful

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 21, 2018, 10:10 UTC
Message-ID
<7f24ee9bf59f91505b8e7cf92715724511f4026e.1524305353.git.johannes.schindelin@gmx.de>
In-Reply-To
<cover.1524305353.git.johannes.schindelin@gmx.de>

This actually only tests whether the push errors/hints are colored if the respective color.* config settings are `always`, but in the regular case they default to `auto` (in which case we color the messages when stderr is connected to an interactive terminal), therefore these tests should suffice.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5541-http-push-smart.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
index 21340e89c96..a2af693068f 100755
--- a/t/t5541-http-push-smart.sh
+++ b/t/t5541-http-push-smart.sh
@@ -377,5 +377,17 @@ test_expect_success 'push status output scrubs password' '
 	grep "^To $HTTPD_URL/smart/test_repo.git" status
 '
 
+test_expect_success 'colorize errors/hints' '
+	cd "$ROOT_PATH"/test_repo_clone &&
+	test_must_fail git -c color.transport=always -c color.advice=always \
+		-c color.push=always \
+		push origin origin/master^:master 2>act &&
+	test_decode_color <act >decoded &&
+	test_i18ngrep "<RED>.*rejected.*<RESET>" decoded &&
+	test_i18ngrep "<RED>error: failed to push some refs" decoded &&
+	test_i18ngrep "<YELLOW>hint: " decoded &&
+	test_i18ngrep ! "^hint: " decoded
+'
+
 stop_httpd
 test_done
-- 
2.17.0.windows.1.15.gaa56ade3205
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 20 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.