Browse Source

Document/usage update for 0.7

Matthew Wang 11 years ago
parent
commit
176bd406a6
3 changed files with 23 additions and 31 deletions
  1. 4
    3
      CHANGES
  2. 12
    18
      README.rst
  3. 7
    10
      cdiff.py

+ 4
- 3
CHANGES View File

@@ -2,10 +2,11 @@
2 2
 Change log
3 3
 ==========
4 4
 
5
-Version 0.7 (2013-02-22)
5
+Version 0.7 (2013-02-23)
6 6
 
7
-  - Support reading diff or log for given files/dirs in workspace (usage changed
8
-    on reading a patch file or two given files!)
7
+  - Support reading diff or log for given files/dirs in workspace
8
+  - Support diff generated from ``diff -ru dir1 dir2``
9
+  - Usage change: reading a patch and comparing two files need stdin redirect
9 10
 
10 11
 Version 0.6 (2013-02-20)
11 12
 

+ 12
- 18
README.rst View File

@@ -6,8 +6,8 @@ Cdiff
6 6
    :alt: Build status
7 7
 
8 8
 Term based tool to view **colored**, **incremental** diff in *Git/Mercurial/Svn*
9
-workspace, given patch or two files, or from stdin, with **side by side** and
10
-**auto pager** support.  Requires python (>= 2.5.0) and ``less``.
9
+workspace or from stdin, with **side by side** and **auto pager** support.
10
+Requires python (>= 2.5.0) and ``less``.
11 11
 
12 12
 .. image:: http://ymattw.github.com/cdiff/img/default.png
13 13
    :alt: default
@@ -68,12 +68,12 @@ Read diff from local modification in a *Git/Mercurial/Svn* workspace:
68 68
 .. code:: sh
69 69
 
70 70
     cd proj-workspace
71
-    cdiff                       # view colored incremental udiff
71
+    cdiff                       # view colored incremental diff
72 72
     cdiff -s                    # view side by side
73 73
     cdiff -s -w 90              # use text width 90 other than default 80
74 74
     cdiff -s file1 dir2         # view modification of given files/dirs only
75 75
 
76
-Read the log with diff (e.g. ``git log -p``, ``svn log --diff``) in a
76
+Read the log with changes (e.g. ``git log -p``, ``svn log --diff``) in a
77 77
 *Git/Mercurial/Svn* workspace (note *--diff* option is new in svn 1.7.0):
78 78
 
79 79
 .. code:: sh
@@ -82,25 +82,19 @@ Read the log with diff (e.g. ``git log -p``, ``svn log --diff``) in a
82 82
     cdiff -l
83 83
     cdiff -ls                   # equivalent to cdiff -l -s
84 84
     cdiff -ls -w90
85
-    cdiff -ls file1 dir2        # view log with diff of given files/dirs only
85
+    cdiff -ls file1 dir2        # see log with changes of given files/dirs only
86 86
 
87 87
 Pipe in a diff:
88 88
 
89 89
 .. code:: sh
90 90
 
91
-    git log -p -2 | cdiff -s
92
-    git show 15bfa5 | cdiff -s
93
-    svn diff -r PREV | cdiff -s
94
-    diff -u foo bar | cdiff     # note cdiff only takes unified diff
95
-    diff -ur dir1 dir2 | cdiff  # read diff of two dirs
96
-
97
-View a diff (patch) file:
98
-
99
-.. code:: sh
100
-
101
-    cdiff < foo.patch           # or cat foo.patch | cdiff
102
-    cdiff -s < foo.patch
103
-    cdiff -s -w 90 < foo.patch
91
+    git log -p -2 | cdiff -s    # view git log with changes of last 2 commits
92
+    git show 15bfa | cdiff -s   # view a git commit
93
+    svn diff -r1234 | cdiff -s  # view svn diff comparing to given revision
94
+    cdiff < foo.patch           # view a patch file (unified format only)
95
+    cat foo.patch | cdiff       # same as above
96
+    diff -u foo bar | cdiff     # pipe in diff between two files (note the '-u')
97
+    diff -ur dir1 dir2 | cdiff  # pipe in diff between two dirs
104 98
 
105 99
 Redirect output to another patch file is safe:
106 100
 

+ 7
- 10
cdiff.py View File

@@ -3,8 +3,8 @@
3 3
 
4 4
 """
5 5
 Term based tool to view **colored**, **incremental** diff in Git/Mercurial/Svn
6
-workspace, given patch or two files, or from stdin, with **side by side** and
7
-**auto pager** support.  Requires python (>= 2.5.0) and ``less``.
6
+workspace or from stdin, with **side by side** and **auto pager** support.
7
+Requires python (>= 2.5.0) and ``less``.
8 8
 """
9 9
 
10 10
 META_INFO = {
@@ -14,9 +14,8 @@ META_INFO = {
14 14
     'email'       : 'mattwyl(@)gmail(.)com',
15 15
     'url'         : 'https://github.com/ymattw/cdiff',
16 16
     'keywords'    : 'colored incremental side-by-side diff',
17
-    'description' : ('View colored, incremental diff in workspace, given patch '
18
-                     'or two files, or from stdin, with side by side and  auto '
19
-                     'pager support')
17
+    'description' : ('View colored, incremental diff in workspace or from '
18
+                     'stdin, with side by side and auto pager support')
20 19
 }
21 20
 
22 21
 import sys
@@ -639,18 +638,16 @@ def main():
639 638
 
640 639
     supported_vcs = sorted(VCS_INFO.keys())
641 640
 
642
-    usage = """
643
-  %prog [options]
644
-  %prog [options] [file ...]"""
641
+    usage = """%prog [options] [file|dir ...]"""
645 642
     parser = optparse.OptionParser(usage=usage,
646 643
             description=META_INFO['description'],
647 644
             version='%%prog %s' % META_INFO['version'])
648 645
     parser.add_option('-s', '--side-by-side', action='store_true',
649
-            help='show in side-by-side mode')
646
+            help='enable side-by-side mode')
650 647
     parser.add_option('-w', '--width', type='int', default=80, metavar='N',
651 648
             help='set text width (side-by-side mode only), default is 80')
652 649
     parser.add_option('-l', '--log', action='store_true',
653
-            help='show diff log from revision control')
650
+            help='show log with changes from revision control')
654 651
     parser.add_option('-c', '--color', default='auto', metavar='X',
655 652
             help='colorize mode "auto" (default), "always", or "never"')
656 653
     opts, args = parser.parse_args()