|
@@ -1,7 +1,36 @@
|
1
|
1
|
## About
|
2
|
2
|
|
3
|
|
-Diff viewer.
|
|
3
|
+Diff viewer, side-by-side, auto pager with `less`.
|
4
|
4
|
|
|
5
|
+## Install
|
|
6
|
+
|
|
7
|
+Just download the `src/cdiff.py` and save to whatever directory which in your
|
|
8
|
+`$PATH`, for example, `$HOME/bin` is in my `$PATH`, so I save the script there
|
|
9
|
+and name as `cdiff`.
|
|
10
|
+
|
|
11
|
+ curl -ksS https://raw.github.com/ymattw/cdiff/master/src/cdiff.py > ~/bin/cdiff
|
|
12
|
+
|
5
|
13
|
## Usage
|
|
14
|
+
|
|
15
|
+Read diff from svn, use option `-s` for side-by-side view, use option `-w` to
|
|
16
|
+use text width other than default `80`. You don't need `less`, it's automatic:
|
|
17
|
+
|
|
18
|
+ svn diff | cdiff
|
|
19
|
+ svn diff | cdiff -s
|
|
20
|
+ svn diff | cdiff -s -w 90
|
|
21
|
+
|
|
22
|
+Read diff from git:
|
|
23
|
+
|
|
24
|
+ git diff | cdiff -s
|
|
25
|
+ git log -p -2 | cdiff -s
|
|
26
|
+ git show <commit> | cdiff -s
|
|
27
|
+
|
|
28
|
+View a diff (patch) file:
|
|
29
|
+
|
|
30
|
+ cdiff foo.patch
|
|
31
|
+ cdiff foo.patch -s
|
|
32
|
+ cdiff foo.patch -s -w 90
|
|
33
|
+
|
|
34
|
+Redirect output to another patch file is safe:
|
6
|
35
|
|
7
|
|
-TODO
|
|
36
|
+ svn diff | cdiff -s > my.patch
|