Raw
1 git-diff-pairs(1)
2 =================
3
4 NAME
5 ----
6 git-diff-pairs - Compare the content and mode of provided blob pairs
7
8 SYNOPSIS
9 --------
10 [synopsis]
11 git diff-pairs -z [<diff-options>]
12
13 DESCRIPTION
14 -----------
15 Show changes for file pairs provided on stdin. Input for this command must be
16 in the NUL-terminated raw output format as generated by commands such as `git
17 diff-tree -z -r --raw`. By default, the outputted diffs are computed and shown
18 in the patch format when stdin closes.
19
20 A single NUL byte may be written to stdin between raw input lines to compute
21 file pair diffs up to that point instead of waiting for stdin to close. A NUL
22 byte is also written to the output to delimit between these batches of diffs.
23
24 Usage of this command enables the traditional diff pipeline to be broken up
25 into separate stages where `diff-pairs` acts as the output phase. Other
26 commands, such as `diff-tree`, may serve as a frontend to compute the raw
27 diff format used as input.
28
29 Instead of computing diffs via `git diff-tree -p -M` in one step, `diff-tree`
30 can compute the file pairs and rename information without the blob diffs. This
31 output can be fed to `diff-pairs` to generate the underlying blob diffs as done
32 in the following example:
33
34 -----------------------------
35 git diff-tree -z -r -M $a $b |
36 git diff-pairs -z
37 -----------------------------
38
39 Computing the tree diff upfront with rename information allows patch output
40 from `diff-pairs` to be progressively computed over the course of potentially
41 multiple invocations.
42
43 Pathspecs are not currently supported by `diff-pairs`. Pathspec limiting should
44 be performed by the upstream command generating the raw diffs used as input.
45
46 Tree objects are not currently supported as input and are rejected.
47
48 Abbreviated object IDs in the `diff-pairs` input are not supported. Outputted
49 object IDs can be abbreviated using the `--abbrev` option.
50
51 OPTIONS
52 -------
53
54 include::diff-options.adoc[]
55
56 include::diff-generate-patch.adoc[]
57
58 GIT
59 ---
60 Part of the linkgit:git[1] suite