push: colorize errors
authorRyan Dammrose <ryandammrose@gmail.com>
Sat, 21 Apr 2018 10:10:00 +0000 (12:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 Apr 2018 01:38:47 +0000 (10:38 +0900)
commit960786e7618942357c45e7e4c234f113e0aea9b1
tree1edc46bc7944e13bc08c8ad4794e39bc14ed1cc3
parent295d949cfabc18fb588f269c77d1f8ff4a613686
push: colorize errors

This is an attempt to resolve an issue I experience with people that are
new to Git -- especially colleagues in a team setting -- where they miss
that their push to a remote location failed because the failure and
success both return a block of white text.

An example is if I push something to a remote repository and then a
colleague attempts to push to the same remote repository and the push
fails because it requires them to pull first, but they don't notice
because a success and failure both return a block of white text. They
then continue about their business, thinking it has been successfully
pushed.

This patch colorizes the errors and hints (in red and yellow,
respectively) so whenever there is a failure when pushing to a remote
repository that fails, it is more noticeable.

[jes: fixed a couple bugs, added the color.{advice,push,transport}
settings, refactored to use want_color_stderr().]

Signed-off-by: Ryan Dammrose ryandammrose@gmail.com
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
advice.c
builtin/push.c
config.c
transport.c