| 
				
			 | 
			
			
				@@ -16,32 +16,37 @@ with **auto pager**.  Requires python (>= 2.5.0) and ``less``. 
			 | 
		
	
		
			
			| 
				16
			 | 
			
				16
			 | 
			
			
				 Installation 
			 | 
		
	
		
			
			| 
				17
			 | 
			
				17
			 | 
			
			
				 ------------ 
			 | 
		
	
		
			
			| 
				18
			 | 
			
				18
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				19
			 | 
			
				
			 | 
			
			
				-Cdiff is not in PyPI yet, so far you could download the script directly or use 
			 | 
		
	
		
			
			| 
				20
			 | 
			
				
			 | 
			
			
				-the ``setup.py`` to install. 
			 | 
		
	
		
			
			| 
				21
			 | 
			
				
			 | 
			
			
				-  
			 | 
		
	
		
			
			| 
				22
			 | 
			
				
			 | 
			
			
				-**Download directly** 
			 | 
		
	
		
			
			| 
				
			 | 
			
				19
			 | 
			
			
				+**Install with pip** 
			 | 
		
	
		
			
			| 
				23
			 | 
			
				20
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				24
			 | 
			
				
			 | 
			
			
				-Save `src/cdiff.py <https://raw.github.com/ymattw/cdiff/master/src/cdiff.py>` to 
			 | 
		
	
		
			
			| 
				25
			 | 
			
				
			 | 
			
			
				-whatever directory which is in your ``$PATH``, for example, ``$HOME/bin`` is in 
			 | 
		
	
		
			
			| 
				26
			 | 
			
				
			 | 
			
			
				-my ``$PATH``, so I save the script there and name as ``cdiff``. 
			 | 
		
	
		
			
			| 
				
			 | 
			
				21
			 | 
			
			
				+Cdiff is already listed on `PyPI <http://pypi.python.org/pypi/cdiff>`, you can 
			 | 
		
	
		
			
			| 
				
			 | 
			
				22
			 | 
			
			
				+install with ``pip`` if you have the tool. 
			 | 
		
	
		
			
			| 
				27
			 | 
			
				23
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				28
			 | 
			
				
			 | 
			
			
				-.. code:: shell 
			 | 
		
	
		
			
			| 
				29
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				30
			 | 
			
				
			 | 
			
			
				-    curl -ksS https://raw.github.com/ymattw/cdiff/master/src/cdiff.py > ~/bin/cdiff 
			 | 
		
	
		
			
			| 
				31
			 | 
			
				
			 | 
			
			
				-    chmod +x ~/bin/cdiff 
			 | 
		
	
		
			
			| 
				
			 | 
			
				24
			 | 
			
			
				+.. code:: sh 
			 | 
		
	
		
			
			| 
				
			 | 
			
				25
			 | 
			
			
				+  
			 | 
		
	
		
			
			| 
				
			 | 
			
				26
			 | 
			
			
				+    sudo pip install cdiff 
			 | 
		
	
		
			
			| 
				32
			 | 
			
				27
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				33
			 | 
			
				
			 | 
			
			
				-**Install with the setup.py** 
			 | 
		
	
		
			
			| 
				
			 | 
			
				28
			 | 
			
			
				+**Install with setup.py** 
			 | 
		
	
		
			
			| 
				34
			 | 
			
				29
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				35
			 | 
			
				
			 | 
			
			
				-You can run the setup.py from the source to install ``cdiff`` to system wide 
			 | 
		
	
		
			
			| 
				36
			 | 
			
				
			 | 
			
			
				-directory. 
			 | 
		
	
		
			
			| 
				
			 | 
			
				30
			 | 
			
			
				+You can also run the setup.py from the source if you don't have ``pip``. 
			 | 
		
	
		
			
			| 
				37
			 | 
			
				31
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				38
			 | 
			
				
			 | 
			
			
				-.. code:: shell 
			 | 
		
	
		
			
			| 
				
			 | 
			
				32
			 | 
			
			
				+.. code:: sh 
			 | 
		
	
		
			
			| 
				39
			 | 
			
				33
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				40
			 | 
			
				34
			 | 
			
			
				     git clone https://github.com/ymattw/cdiff.git 
			 | 
		
	
		
			
			| 
				41
			 | 
			
				35
			 | 
			
			
				     cd cdiff 
			 | 
		
	
		
			
			| 
				42
			 | 
			
				36
			 | 
			
			
				     sudo ./setup.py install 
			 | 
		
	
		
			
			| 
				43
			 | 
			
				37
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				44
			 | 
			
				
			 | 
			
			
				-This usually installs it as ``/usr/local/bin/cdiff``. 
			 | 
		
	
		
			
			| 
				
			 | 
			
				38
			 | 
			
			
				+**Download directly** 
			 | 
		
	
		
			
			| 
				
			 | 
			
				39
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				40
			 | 
			
			
				+Both ``pip`` and ``setup.py`` installs cdiff to system wide directory, if you 
			 | 
		
	
		
			
			| 
				
			 | 
			
				41
			 | 
			
			
				+want a minimal tool without the boring external dependencies (like me), just 
			 | 
		
	
		
			
			| 
				
			 | 
			
				42
			 | 
			
			
				+save `src/cdiff.py <https://raw.github.com/ymattw/cdiff/master/src/cdiff.py>` to 
			 | 
		
	
		
			
			| 
				
			 | 
			
				43
			 | 
			
			
				+whatever directory which is in your ``$PATH``, for example, ``$HOME/bin`` is 
			 | 
		
	
		
			
			| 
				
			 | 
			
				44
			 | 
			
			
				+in my ``$PATH``, so I save the script there and name as ``cdiff``. 
			 | 
		
	
		
			
			| 
				
			 | 
			
				45
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				46
			 | 
			
			
				+.. code:: sh 
			 | 
		
	
		
			
			| 
				
			 | 
			
				47
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				48
			 | 
			
			
				+    curl -ksS https://raw.github.com/ymattw/cdiff/master/src/cdiff.py > ~/bin/cdiff 
			 | 
		
	
		
			
			| 
				
			 | 
			
				49
			 | 
			
			
				+    chmod +x ~/bin/cdiff 
			 | 
		
	
		
			
			| 
				45
			 | 
			
				50
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				46
			 | 
			
				51
			 | 
			
			
				 Usage 
			 | 
		
	
		
			
			| 
				47
			 | 
			
				52
			 | 
			
			
				 ----- 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -57,7 +62,7 @@ Show usage:: 
			 | 
		
	
		
			
			| 
				57
			 | 
			
				62
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				58
			 | 
			
				63
			 | 
			
			
				 View a diff (patch) file: 
			 | 
		
	
		
			
			| 
				59
			 | 
			
				64
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				60
			 | 
			
				
			 | 
			
			
				-.. code:: shell 
			 | 
		
	
		
			
			| 
				
			 | 
			
				65
			 | 
			
			
				+.. code:: sh 
			 | 
		
	
		
			
			| 
				61
			 | 
			
				66
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				62
			 | 
			
				67
			 | 
			
			
				     cdiff foo.patch             # view colored incremental udiff 
			 | 
		
	
		
			
			| 
				63
			 | 
			
				68
			 | 
			
			
				     cdiff foo.patch -s          # view side by side 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -65,7 +70,7 @@ View a diff (patch) file: 
			 | 
		
	
		
			
			| 
				65
			 | 
			
				70
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				66
			 | 
			
				71
			 | 
			
			
				 Read diff from local modification in a svn, git, or hg workspace: 
			 | 
		
	
		
			
			| 
				67
			 | 
			
				72
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				68
			 | 
			
				
			 | 
			
			
				-.. code:: shell 
			 | 
		
	
		
			
			| 
				
			 | 
			
				73
			 | 
			
			
				+.. code:: sh 
			 | 
		
	
		
			
			| 
				69
			 | 
			
				74
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				70
			 | 
			
				75
			 | 
			
			
				     cd proj-workspace 
			 | 
		
	
		
			
			| 
				71
			 | 
			
				76
			 | 
			
			
				     cdiff 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -74,15 +79,15 @@ Read diff from local modification in a svn, git, or hg workspace: 
			 | 
		
	
		
			
			| 
				74
			 | 
			
				79
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				75
			 | 
			
				80
			 | 
			
			
				 Pipe in a diff: 
			 | 
		
	
		
			
			| 
				76
			 | 
			
				81
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				77
			 | 
			
				
			 | 
			
			
				-.. code:: shell 
			 | 
		
	
		
			
			| 
				
			 | 
			
				82
			 | 
			
			
				+.. code:: sh 
			 | 
		
	
		
			
			| 
				78
			 | 
			
				83
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				79
			 | 
			
				
			 | 
			
			
				-    svn diff -r PREV | cdiff -s 
			 | 
		
	
		
			
			| 
				80
			 | 
			
				84
			 | 
			
			
				     git log -p -2 | cdiff -s 
			 | 
		
	
		
			
			| 
				81
			 | 
			
				
			 | 
			
			
				-    git show <commit> | cdiff -s 
			 | 
		
	
		
			
			| 
				
			 | 
			
				85
			 | 
			
			
				+    git show 15bfa56 | cdiff -s 
			 | 
		
	
		
			
			| 
				
			 | 
			
				86
			 | 
			
			
				+    svn diff -r PREV | cdiff -s 
			 | 
		
	
		
			
			| 
				82
			 | 
			
				87
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				83
			 | 
			
				88
			 | 
			
			
				 Redirect output to another patch file is safe: 
			 | 
		
	
		
			
			| 
				84
			 | 
			
				89
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				85
			 | 
			
				
			 | 
			
			
				-.. code:: shell 
			 | 
		
	
		
			
			| 
				
			 | 
			
				90
			 | 
			
			
				+.. code:: sh 
			 | 
		
	
		
			
			| 
				86
			 | 
			
				91
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				87
			 | 
			
				92
			 | 
			
			
				     svn diff | cdiff -s > my.patch 
			 | 
		
	
		
			
			| 
				88
			 | 
			
				93
			 | 
			
			
				  
			 |