patchview
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
So what is patchview? It is a wrapper of filterdiff for use with numbered files.
$ patchview
Without args is equivalent to: lsdiff --number
$ patchview -F2-
With one or more args is equivalent to: filterdiff args
There are 4 scripts for working with git repos (gitdiff, gitdiffview, gitshow and gitshowview) and 2 for svn (svndiff and svndiffview).
Also these scripts have option -v which shows the full command that is which is being executed.
$ svndiff
$ gitdiff
Without args, will give the list of files modified
With args will show the patches according the args, for example, `gitdiff -F1` will show the patch for first file
$ svndiffview
$ gitdiffview
Without args will pipe all patches through filterdiff to `vim - -R` (in read-only mode, easy to quit), showing complete patch with colors.
With args will pipe the patches according the args, for example, `gitsvnview -F2` will pipe the patch for second file to `vim - -R`.
$ gitshow
$ gitshowview
Is the same of gitdiff but use `git show` instead of `git diff`.
Example:
We can make the following one-line script with the name difftotrunk.sh, to view the differences of two directories or svn repos (trunk and .)
diff ../trunk . -ru -x .svn | patchview "$@"
$ ./difftotrunk.sh , will show all different files and his number.
$ ./difftotrunk.sh -F3,4 , will show the differences of files #3 and #4 only.
$ ./difftotrunk.sh -F3 -#1, will show only hunk #1 of file #3.
$ ./difftotrunk.sh -F3 -#x1, will show the differences of files #3 without hunk #1 (x means that exclude).