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

11
fish/functions/cvsd.fish Normal file
View file

@ -0,0 +1,11 @@
function cvsd --wraps 'cvs diff'
if type -q colordiff
command cvs diff -uN $argv | colordiff | less -FRX
else
set -l red (tput setaf 1)
set -l green (tput setaf 2)
set -l reset (tput sgr0)
cvs diff -uN $argv | sed "s/^+.*\$/$green&$reset/" |
sed "s/^-.*\$/$red&$reset/" | less -FRX
end
end

View file

@ -1,5 +1,5 @@
function fld --wraps 'fossil diff'
if type -q colordiff2
if type -q colordiff
command fossil diff -N $argv | colordiff | less -FRX
else
set -l red (tput setaf 1)

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 &&