Add cvsd to get a colored cvs diff
This commit is contained in:
parent
4a1740f2d6
commit
dc82e6298f
3 changed files with 26 additions and 1 deletions
11
fish/functions/cvsd.fish
Normal file
11
fish/functions/cvsd.fish
Normal 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
|
|
@ -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
14
zshrc
|
@ -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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue