summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--textproc/cdiff/Makefile2
-rw-r--r--textproc/cdiff/src/cdiff.16
-rw-r--r--textproc/cdiff/src/cdiff.sh7
3 files changed, 12 insertions, 3 deletions
diff --git a/textproc/cdiff/Makefile b/textproc/cdiff/Makefile
index f519fe08a882..ec80ff9d54b6 100644
--- a/textproc/cdiff/Makefile
+++ b/textproc/cdiff/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= cdiff
-PORTVERSION= 1.3
+PORTVERSION= 1.4
CATEGORIES= textproc
MASTER_SITES= # none
DISTFILES= # none
diff --git a/textproc/cdiff/src/cdiff.1 b/textproc/cdiff/src/cdiff.1
index eaa617a574af..551928a81118 100644
--- a/textproc/cdiff/src/cdiff.1
+++ b/textproc/cdiff/src/cdiff.1
@@ -42,6 +42,7 @@ files and URLs, adds color codes, expands tabs to 8 spaces, and passes the
results to
.Xr less 1 .
If used on a color terminal, it makes diffs much easier to read.
+There is also handling of "cvs annotate" in it.
.Sh AUTHORS
.Nm
was written by
@@ -50,13 +51,14 @@ based on a sed line somebody passed around. The code is (much) smaller than
this man page.
.Sh SEE ALSO
.Xr diff 1 ,
-.Xr less 1 .
+.Xr less 1 ,
+.Xr cvs 1 .
.Sh BUGS
.Nm
assumes standard ANSI color escape sequences (as used by xterm and most other
commonly used terminals), rather than using
.Xr curses 3 .
-
+.Pp
.Nm
should really be a large and complex C program based on
.Xr less 1
diff --git a/textproc/cdiff/src/cdiff.sh b/textproc/cdiff/src/cdiff.sh
index 097af55fb404..3823d3b63322 100644
--- a/textproc/cdiff/src/cdiff.sh
+++ b/textproc/cdiff/src/cdiff.sh
@@ -22,4 +22,11 @@ s/^(\*\*\* \d+,\d+ *\*\*\*.*)$/\033[1m$1\033[m/o;
s/^(\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*)$/\033[1m$1\033[m/o;
s/^(!.*)$/\033[35m$1\033[m/o;
s/^(@@.*$)/\033[1m$1\033[m/o;
+if (/^1.(\d+)(\s+\(\w+\s+\d{2}-\w{3}-\d{2}\):\s)(.*)/) {
+ $lastcol = $lastcol || 0;
+ $lastcol++ if defined($lastrev) && $lastrev != $1;
+ $lastrev = $1;
+ $lastcol %= 6;
+ $_ = "\033[3" . ($lastcol + 1) . "m1.$1$2\033[m$3\n";
+}
' | less -R