File: README.patchview

package info (click to toggle)
patchutils 0.4.2-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,248 kB
  • sloc: ansic: 6,181; sh: 6,143; xml: 2,750; perl: 409; makefile: 248; python: 23
file content (46 lines) | stat: -rw-r--r-- 1,367 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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-
    (or with any other args)
    
is equivalent to: filterdiff -F2- (or whatever arguments are supplied)

There are two scripts for working with git (gitdiff and gitdiffview) and two for svn (svndiff and svndiffview).

    $ svndiff
    $ gitdiff
    (without args)
    
will give the list of files modified

    $ svndiff -F1
    $ gitdiff -F1
    
will show the patch of file #1

    $ svndiffview
    $ gitdiffview
    
pipe all patches through filterdiff to `vim - -R` (in read-only mode, easy to quit), showing complete patch with color.

    $ svndiffview -F2
    $ gitdiffview -F2
    (or any other args)

will pipe patch of file #2 to `vim - -R`

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).