|
@@ -45,9 +45,7 @@ You can also run the setup.py from the source if you don't have ``pip``.
|
45
|
45
|
Download directly
|
46
|
46
|
~~~~~~~~~~~~~~~~~
|
47
|
47
|
|
48
|
|
-Both ``pip`` and ``setup.py`` installs cdiff to system wide directory, if you
|
49
|
|
-want a minimal tool without the boring external dependencies (like me), just
|
50
|
|
-save `cdiff.py <https://raw.github.com/ymattw/cdiff/master/cdiff.py>`_ to
|
|
48
|
+Just save `cdiff.py <https://raw.github.com/ymattw/cdiff/master/cdiff.py>`_ to
|
51
|
49
|
whatever directory which is in your ``$PATH``, for example, ``$HOME/bin`` is in
|
52
|
50
|
my ``$PATH``, so I save the script there and name as ``cdiff``.
|
53
|
51
|
|
|
@@ -59,23 +57,20 @@ my ``$PATH``, so I save the script there and name as ``cdiff``.
|
59
|
57
|
Usage
|
60
|
58
|
-----
|
61
|
59
|
|
62
|
|
-Cdiff reads diff from diff (patch) file if given, or stdin if redirected, or
|
63
|
|
-diff produced by revision tool if in a git/svn/hg workspace. Use option ``-s``
|
64
|
|
-to enable side by side view, and option ``-w N`` to set a text width other than
|
65
|
|
-default ``80``. See examples below.
|
|
60
|
+Show usage:
|
66
|
61
|
|
67
|
|
-Show usage::
|
|
62
|
+.. code:: sh
|
68
|
63
|
|
69
|
64
|
cdiff -h
|
70
|
65
|
|
71
|
|
-Read diff from local modification in a svn, git, or hg workspace:
|
|
66
|
+Read diff from local modification in a *svn*, *git*, or *hg* workspace:
|
72
|
67
|
|
73
|
68
|
.. code:: sh
|
74
|
69
|
|
75
|
70
|
cd proj-workspace
|
76
|
|
- cdiff # view colored incremental udiff
|
77
|
|
- cdiff -s # view side by side
|
78
|
|
- cdiff -s -w 90 # use text width 90 other than default 80
|
|
71
|
+ cdiff # view colored incremental udiff
|
|
72
|
+ cdiff -s # view side by side
|
|
73
|
+ cdiff -s -w 90 # use text width 90 other than default 80
|
79
|
74
|
|
80
|
75
|
Pipe in a diff:
|
81
|
76
|
|
|
@@ -93,9 +88,11 @@ View a diff (patch) file:
|
93
|
88
|
cdiff foo.patch -s
|
94
|
89
|
cdiff foo.patch -s -w 90
|
95
|
90
|
|
96
|
|
-View diff between two files (wrapper of ``diff``)::
|
|
91
|
+View diff between two files (wrapper of ``diff``):
|
|
92
|
+
|
|
93
|
+.. code:: sh
|
97
|
94
|
|
98
|
|
- cdiff foo foo.new # equivalent to diff -u foo foo.new | cdiff
|
|
95
|
+ cdiff foo foo.new # equivalent to diff -u foo foo.new | cdiff
|
99
|
96
|
cdiff foo foo.new -s
|
100
|
97
|
|
101
|
98
|
Redirect output to another patch file is safe:
|
|
@@ -112,10 +109,10 @@ Notes
|
112
|
109
|
- Only takes unified diff for input
|
113
|
110
|
- Side by side mode has alignment problem for wide chars
|
114
|
111
|
|
115
|
|
-Pull request is very welcome, make sure run ``make test`` to verify. Single
|
116
|
|
-commit in pull request would make it easier for review, for example to collapse
|
117
|
|
-last 3 commits into 1 before *push*, use ``git rebase -i HEAD~3``, *pick* the
|
118
|
|
-first and *squash* the other two.
|
|
112
|
+Pull request is very welcome, make sure run ``make test`` and ``make test3`` to
|
|
113
|
+verify. Single commit in pull request would make it easier for review, for
|
|
114
|
+example to collapse last 3 commits into 1 before *push*, use ``git rebase -i
|
|
115
|
+HEAD~3``, *pick* the first and *squash* the other two.
|
119
|
116
|
|
120
|
117
|
See also
|
121
|
118
|
--------
|