p4 diff2 (graph)

Diff utility for comparing the content at two repo paths. (For comparing workspace content to repo content, see p4 diff (graph).)

Syntax

p4 diff2 [options] fromFile[@sha1|@reference] tofile[@sha1|@reference]

Description

p4 diff2 runs on the server to compare one set of graph repo files (the 'source') to another (the 'target'). Source and target file sets can be specified on the 'p4 diff2' command line.

fromFile and toFile can include @sha1 or @reference specifiers; by default, the head revisions are diffed.

'p4 diff2' precedes each diffed file pair with a header line of the

following form:

==== source#rev (type) - target#rev (type) ==== summary

A source or target file shown as '<none>' means there is no file at the specified name or reference to pair with its counterpart. The summary status is one of the following: 'identical' means file contents and types are identical, 'types' means file contents are identical but the types are different, and 'content' means file contents are different.

Options

-doptions

Runs the diff routine with one of a subset of the standard UNIX diff options. See p4 diff2 (graph) for a listing of these options.

-Od

Limit output to only those files that differ.

-q

Quiet diff. Display only the header; if file1 and file2 are identical, display only "file1 - no differing files" as the output.

-u

Generate unified output format, showing added and deleted lines with sufficient context for compatibility with the patch(1) utility. Only those files that differ are included. File names and dates remain in Helix Server syntax.

Examples

p4 diff2 //repo/main/src/...@00662f4 //repo/main/src/...@refs/heads/bugfix

where @00662f4 represents the commit SHA-1 and refs/heads/bugfix represents the branch. The output might show differences between the files currently in the branch and files in the commit:

==== //repo/main/src/chat.c#1e7637e (text) - //repo/main/src/chat.c#1e7637e (text) ==== identical
==== //repo/main/src/db.c#6950848 (text) - //repo/main/src/db.c#2ab62af (text) ==== content
2,3d1
< Additional database code.
< Add Btree code
==== //repo/main/src/main.c#184e90a (text) - //repo/main/src/main.c#5a8f6ff (text) ==== content
3d2
< Enable additional database code.

where #number represents the blob SHA-1 of a file associated with the commit SHA-1.