it's possible to create an git alias to colorize the output, in error case, of git push command?
I have one that works to log, but i can't modify it to works with push.
git log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%C(62)\\ [%cn]\\ %ce" --decorate
example of error message:
"error: failed to push some refs to 'https://github.com/user/projectname.git'"
What should the push print?
push printout the result of the "pushed" code to the server. You can have server side hook which sends out colored messages to the user.
pre-receive hook#!/bin/sh
# Output colors
red='\033[0;31m';
green='\033[0;32m';
yellow='\033[0;33m';
default='\033[0;m';
# personal touch :-)
echo "${red}"
echo " "
echo " |ZZzzz "
echo " | "
echo " | "
echo " |ZZzzz /^\ |ZZzzz "
echo " | |~~~| | "
echo " | |- -| / \ "
echo " /^\ |[]+ | |^^^| "
echo " |^^^^^^^| | +[]| | | "
echo " | +[]|/\/\/\/\^/\/\/\/\/|^^^^^^^| "
echo " |+[]+ |~~~~~~~~~~~~~~~~~~| +[]| "
echo " | | [] /^\ [] |+[]+ | "
echo " | +[]+| [] || || [] | +[]+| "
echo " |[]+ | || || |[]+ | "
echo " |_______|------------------|_______| "
echo " "
echo " "
echo " ${green}You have just committed code ${red} "
echo " Your code ${yellow}is bad.!!! "
echo " ${red} Do not ever commit again "
echo " "
echo "${default}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With