Skip to content
/ git Public
forked from git/git

Latest commit

 

History

History
60 lines (45 loc) · 1.96 KB

git-diff-pairs.adoc

File metadata and controls

60 lines (45 loc) · 1.96 KB

git-diff-pairs(1)

NAME

git-diff-pairs - Compare the content and mode of provided blob pairs

SYNOPSIS

git diff-pairs -z [<diff-options>]

DESCRIPTION

Show changes for file pairs provided on stdin. Input for this command must be in the NUL-terminated raw output format as generated by commands such as git diff-tree -z -r --raw. By default, the outputted diffs are computed and shown in the patch format when stdin closes.

A single NUL byte may be written to stdin between raw input lines to compute file pair diffs up to that point instead of waiting for stdin to close. A NUL byte is also written to the output to delimit between these batches of diffs.

Usage of this command enables the traditional diff pipeline to be broken up into separate stages where diff-pairs acts as the output phase. Other commands, such as diff-tree, may serve as a frontend to compute the raw diff format used as input.

Instead of computing diffs via git diff-tree -p -M in one step, diff-tree can compute the file pairs and rename information without the blob diffs. This output can be fed to diff-pairs to generate the underlying blob diffs as done in the following example:

git diff-tree -z -r -M $a $b |
git diff-pairs -z

Computing the tree diff upfront with rename information allows patch output from diff-pairs to be progressively computed over the course of potentially multiple invocations.

Pathspecs are not currently supported by diff-pairs. Pathspec limiting should be performed by the upstream command generating the raw diffs used as input.

Tree objects are not currently supported as input and are rejected.

Abbreviated object IDs in the diff-pairs input are not supported. Outputted object IDs can be abbreviated using the --abbrev option.

GIT

Part of the linkgit:git[1] suite