Colored SVN status and log output, page long commands.
Copy svn.sh
contents into your .bashrc
/ .zshrc
or clone and add the following line instead:
source ~/path/to/svn.sh
svn() { | |
# Exit if no command was specified | |
if [ $# -lt 1 ]; then | |
command svn | |
return | |
fi | |
local cmd=$1 | |
shift | |
if [[ $cmd =~ ^(status|stat|st)$ ]]; then | |
command svn $cmd "$@" | \ | |
colout "^[MAR]" green | \ | |
colout "^\!.*" yellow | \ | |
colout "^D" red | \ | |
colout "^\?.*" black | \ | |
colout "^\s*\*.*" blue | |
elif [[ $cmd =~ ^(blame|help|h|cat)$ ]]; then | |
command svn $cmd "$@" | less -RF | |
elif [[ $cmd == log ]]; then | |
command svn $cmd "$@" | \ | |
colout "^-+\$" black | \ | |
colout \ | |
"^(r\d+)\s+(\|)\s+([^|]+)\s+(\|)\s+([^|]+)\s+(\|)\s+([^|]+)" \ | |
blue,black,green,black,white,black,red normal,bold,normal | \ | |
less -RF | |
else | |
command svn $cmd "$@" | |
fi | |
} |
Colored SVN status and log output, page long commands.
Copy svn.sh
contents into your .bashrc
/ .zshrc
or clone and add the following line instead:
source ~/path/to/svn.sh