File: colordiff.1

package info (click to toggle)
colordiff 1.0.9-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 136 kB
  • ctags: 5
  • sloc: perl: 341; xml: 152; makefile: 41; sh: 38
file content (145 lines) | stat: -rw-r--r-- 3,814 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
.\"     Title: colordiff
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\"      Date: 01/25/2009
.\"    Manual: 
.\"    Source: 
.\"
.TH "COLORDIFF" "1" "01/25/2009" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
colordiff \- a tool to colorize diff output
.SH "SYNOPSIS"
.HP 10
\fBcolordiff\fR [\fI\fBdiff\fR\fR\fI\ options\fR] [\fIcolordiff\fR\fI\ options\fR] {\fIfile1\fR} {\fIfile2\fR}
.SH "DESCRIPTION"
.PP
colordiff
is a wrapper for
\fBdiff\fR
and produces the same output as
\fBdiff\fR
but with coloured syntax highlighting at the command line to improve readability\&. The output is similar to how a
\fBdiff\fR\-generated patch might appear in
Vim
or
Emacs
with the appropriate syntax highlighting options enabled\&. The colour schemes can be read from a central configuration file or from a local user
\fI~/\&.colordiffrc\fR
file\&.
.PP
colordiff
makes use of ANSI colours and as such will only work when ANSI colours can be used \- typical examples are xterms and Eterms, as well as console sessions\&.
.PP
colordiff
has been tested on various flavours of Linux and under OpenBSD, but should be broadly portable to other systems\&.
.SH "USAGE"
.PP
Use
colordiff
wherever you would normally use
\fBdiff\fR, or pipe output to
colordiff:
.PP
For example:
.sp
.RS 4
.nf
$ colordiff file1 file2
$ diff \-u file1 file2 | colordiff
.fi
.RE
.PP
You can pipe the output to \'less\', using the \'\-R\' option (some systems or terminal types may get better results using \'\-r\' instead), which keeps the colour escape sequences, otherwise displayed incorrectly or discarded by \'less\':
.sp
.RS 4
.nf
$ diff \-u file1 file2 | colordiff | less \-R
.fi
.RE
.PP
If you have
\fBwdiff\fR
installed, colordiff will correctly colourise the added and removed text, provided that the \'\-n\' option is given to
\fBwdiff\fR:
.sp
.RS 4
.nf
$ wdiff \-n file1 file2 | colordiff
.fi
.RE
.PP
You may find it useful to make
\fBdiff\fR
automatically call
\fBcolordiff\fR\&. Add the following line to
\fI~/\&.bashrc\fR
(or equivalent):
.sp
.RS 4
.nf
alias diff=colordiff
.fi
.RE
.PP
Any options passed to
colordiff
are passed through to
\fBdiff\fR
except for the colordiff\-specific option \'difftype\', e\&.g\&.
.sp
.RS 4
.nf
colordiff \-\-difftype=debdiff file1 file2
.fi
.RE
.PP
Valid values for \'difftype\' are: diff, diffc, diffu, diffy, wdiff, debdiff; these correspond to plain diffs, context diffs, unified diffs, side\-by\-side diffs, wdiff output and debdiff output respectively\&. Use these overrides when colordiff is not able to determine the diff\-type automatically\&.
.PP
Alternatively, a construct such as \'cvs diff SOMETHING | colordiff\' can be included in
\fI~/\&.bashrc\fR
as follows:
.sp
.RS 4
.nf
function cvsdiff () { cvs diff $@ | colordiff; }
.fi
.RE
.PP
Or, combining the idea above using \'less\':
.sp
.RS 4
.nf
function cvsdiff () { cvs diff $@ | colordiff |less \-R; }
.fi
.RE
.PP
Note that the function name, cvsdiff, can be customized\&.
.SH "FILES"
.PP
\fI/etc/colordiffrc\fR
.RS 4
Central configuration file\&. User\-specific settings can be enabled by copying this file to
\fI~/\&.colordiffrc\fR
and making the appropriate changes\&.
.RE
.PP
\fIcolordiffrc\-lightbg\fR
.RS 4
Alternate configuration template for use with terminals having light backgrounds\&. Copy this to /etc/colordiffrc or ~/\&.colordiffrc and customize\&.
.RE
.SH "BUGS"
.PP
Bug reports and suggestions/patches to
<davee@sungate\&.co\&.uk>
please\&.
.SH "AUTHOR"
.PP
colordiff
is written and maintained by Dave Ewart
<davee@sungate\&.co\&.uk>\&. This manual page and the source XML was written by Graham Wilson
<graham@mknod\&.org>
for Debian and is maintained by the author\&. Dave Ewart maintains the Debian package.