1
1
Fork 0

Add cvsd to get a colored cvs diff

This commit is contained in:
Jonathan Schleifer 2020-08-30 03:44:27 +00:00
parent 4a1740f2d6
commit dc82e6298f
3 changed files with 26 additions and 1 deletions

14
zshrc
View file

@ -299,6 +299,20 @@ if which fossil &>/dev/null; then
}
fi
if which cvs &>/dev/null; then
cvsd() {
if which colordiff &>/dev/null; then
cvs diff -uN "$@" | colordiff | less -FRX
else
red="$(tput setaf 1)"
green="$(tput setaf 2)"
reset="$(tput sgr0)"
cvs diff -uN "$@" | sed "s/^+.*$/$green&$reset/" |
sed "s/^-.*$/$red&$reset/" | less -FRX
fi
}
fi
# pkgsrc does not like MAKEFLAGS including -j
which pkg_chk &>/dev/null && alias pkg_chk="MAKEFLAGS= pkg_chk"
which pkg_rolling-replace &>/dev/null &&