git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Jacob Keller" <jacob.keller@gmail.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v3 0/4] Colorize push errors
Date: Sat, 21 Apr 2018 12:09:52 +0200 (DST)	[thread overview]
Message-ID: <cover.1524305353.git.johannes.schindelin@gmx.de> (raw)
In-Reply-To: <cover.1522968472.git.johannes.schindelin@gmx.de>

To help users discern large chunks of white text (when the push
succeeds) from large chunks of white text (when the push fails), let's
add some color to the latter.

The original contribution came in via Pull Request from the Git for
Windows project:

	https://github.com/git-for-windows/git/pull/1429

I almost forgot to submit v3. Guess it's a good thing I have a project
management system with tickets I can move through a story board...

Changes since v2:

- removed a bogus "squash! ..." from the commit message of 2/4

- removed the unnecessary here-doc from the test added in 4/4

- renamed color.advice.advice to color.advice.hint in 2/4 and 4/4


Johannes Schindelin (3):
  color: introduce support for colorizing stderr
  Add a test to verify that push errors are colorful
  Document the new color.* settings to colorize push errors/hints

Ryan Dammrose (1):
  push: colorize errors

 Documentation/config.txt   | 28 ++++++++++++++++
 advice.c                   | 49 ++++++++++++++++++++++++++--
 builtin/push.c             | 44 ++++++++++++++++++++++++-
 color.c                    | 20 +++++++-----
 color.h                    |  4 ++-
 config.c                   |  2 +-
 t/t5541-http-push-smart.sh | 12 +++++++
 transport.c                | 67 +++++++++++++++++++++++++++++++++++++-
 8 files changed, 211 insertions(+), 15 deletions(-)


base-commit: fe0a9eaf31dd0c349ae4308498c33a5c3794b293
Published-As: https://github.com/dscho/git/releases/tag/colorize-push-errors-v3
Fetch-It-Via: git fetch https://github.com/dscho/git colorize-push-errors-v3

Interdiff vs v2:
 diff --git a/Documentation/config.txt b/Documentation/config.txt
 index 1fef60a7301..2cea0c6c899 100644
 --- a/Documentation/config.txt
 +++ b/Documentation/config.txt
 @@ -1095,7 +1095,7 @@ color.advice::
  	are used only when the error output goes to a terminal. If
  	unset, then the value of `color.ui` is used (`auto` by default).
  
 -color.advice.advice::
 +color.advice.hint::
  	Use customized color for hints.
  
  color.branch::
 diff --git a/advice.c b/advice.c
 index 2121c1811fd..89fda1de55b 100644
 --- a/advice.c
 +++ b/advice.c
 @@ -36,7 +36,7 @@ static int parse_advise_color_slot(const char *slot)
  {
  	if (!strcasecmp(slot, "reset"))
  		return ADVICE_COLOR_RESET;
 -	if (!strcasecmp(slot, "advice"))
 +	if (!strcasecmp(slot, "hint"))
  		return ADVICE_COLOR_HINT;
  	return -1;
  }
 diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
 index 1c2be98dc2b..a2af693068f 100755
 --- a/t/t5541-http-push-smart.sh
 +++ b/t/t5541-http-push-smart.sh
 @@ -379,12 +379,6 @@ test_expect_success 'push status output scrubs password' '
  
  test_expect_success 'colorize errors/hints' '
  	cd "$ROOT_PATH"/test_repo_clone &&
 -	cat >exp <<-EOF &&
 -	To http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git
 -	 <RED>! [rejected]       <RESET> origin/master^ -> master (non-fast-forward)
 -	error: failed to push some refs to '\''http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git'\''
 -	EOF
 -
  	test_must_fail git -c color.transport=always -c color.advice=always \
  		-c color.push=always \
  		push origin origin/master^:master 2>act &&
-- 
2.17.0.windows.1.15.gaa56ade3205


  parent reply	other threads:[~2018-04-21 10:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16 12:25 [PATCH 0/1] Colorize some errors on stderr Johannes Schindelin
2018-02-16 12:25 ` [PATCH 1/1] Colorize push errors Johannes Schindelin
2018-02-16 19:21 ` [PATCH 0/1] Colorize some errors on stderr Junio C Hamano
2018-04-06 11:21   ` Johannes Schindelin
2018-04-05 22:48 ` [PATCH v2 0/4] Colorize push errors Johannes Schindelin
2018-04-05 22:48   ` [PATCH v2 1/4] color: introduce support for colorizing stderr Johannes Schindelin
2018-04-05 22:48   ` [PATCH v2 2/4] push: colorize errors Johannes Schindelin
2018-04-05 23:37     ` Jacob Keller
2018-04-06 11:15       ` Johannes Schindelin
2018-04-05 22:48   ` [PATCH v2 3/4] Add a test to verify that push errors are colorful Johannes Schindelin
2018-04-06 10:50     ` Eric Sunshine
2018-04-06 12:13       ` Johannes Schindelin
2018-04-05 22:48   ` [PATCH v2 4/4] Document the new color.* settings to colorize push errors/hints Johannes Schindelin
2018-04-06 10:56     ` Eric Sunshine
2018-04-06 12:15       ` Johannes Schindelin
2018-04-07  6:55         ` Eric Sunshine
2018-04-21 10:09   ` Johannes Schindelin [this message]
2018-04-21 10:09     ` [PATCH v3 1/4] color: introduce support for colorizing stderr Johannes Schindelin
2018-04-21 10:10     ` [PATCH v3 2/4] push: colorize errors Johannes Schindelin
2018-04-21 10:10     ` [PATCH v3 3/4] Add a test to verify that push errors are colorful Johannes Schindelin
2018-04-21 10:10     ` [PATCH v3 4/4] Document the new color.* settings to colorize push errors/hints Johannes Schindelin
2018-04-06 18:48 ` [PATCH 0/1] Colorize some errors on stderr Ævar Arnfjörð Bjarmason

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=cover.1524305353.git.johannes.schindelin@gmx.de \
    --to=johannes.schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.keller@gmail.com \
    --cc=sunshine@sunshineco.com \
    /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).