Re: -p diff output and the 'Index:' line
- From
- Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
- Date
- May 29, 2005, 12:36 UTC
- Message-ID
- <20050529123624.GJ4881@cip.informatik.uni-erlangen.de>
- In-Reply-To
- <2788.10.10.10.24.1117353158.squirrel@linux1>
Hello, I actually use the following bash script to browse the diffs with what-changed:
(faui03) [~/work/monitor] git-whatchanged -p | cdiff ...
# COLORDEFINITIONS BLACK="[0;30m" RED="[0;31m" GREEN="[0;32m" YELLO="[0;33m" BLUE="[0;34m" PURPLE="[0;35m" CYAN="[0;36m" WHITE="[0;37m" END="[0m" REVERSE="[7m"
cdiff()
{
cat $1 | \
sed -e " \
s/^\(diff-tree\)\(.*\)/\1${RED}\2${END}/; \
s/^+.*/$RED&$END/; \
s/^-.*/$BLUE&$END/; \
s/^@.*/$GREEN&$END/; \
s/^Date.*/$RED&$END/; \
s/^Author.*/$RED&$END/; \
" | less -R -i -p "^diff-tree"# This would highlight manpages but the last line clashes with cdiff # --tg 00:52 05-05-26 #s/^[A-Z]\+[A-Z ]\+$/$RED&$END/; \ #s/[A-Z]\+([0-9])/$RED&$END/g; \ # s/\W--\?[0-9a-zA-Z=-]\+/$BLUE&$END/g; \ }
Gruesse, Thomas