Manpage logo

bk-diff - (unknown subject)


NAME
bk diff − show differences in revision controlled files

SYNOPSIS
bk diff
[opts] [file ... ]

DESCRIPTION
The bk diff command is typically used to show changes to working files relative to the previously checked in version. Unified diffs are produced by default.

The bk diff command supports context, unified, procedural, and side-by-side diffs. All of the above can be optionally annotated with filename, author, date, and/or revision numbers.

To view changes you have made to all of the files in the current directory:

$ bk diff

To see the changes for all files in your tree:

$ bk −U diff

OPTIONS
−A
bdpru Align prefix output in a human readable form. The set of annotations will be followed by a vertical bar and a space before the data from each line of the file starts. Each annotation is aligned in a column. The option argument[s] turn on one or more annotations as a prefix to each line. The possible annotations are:

b Prefix each line with the basename of the file.
d
Prefix each line with the date of last modification.
p
Prefix each line with pathname of the file relative to the root of the repository.
r
Prefix each line with the revision of last modification.
u
Prefix each line the name of the user who last modified it.

−abdpru Similar to −A but without the alignment.
−b
Ignore changes in amount of white space.
−B
Ignore changes that just insert or delete blank lines.
−c
Do old-style context diffs.
−d
date Instead of using revision[s] as the versions to diff, use the revision[s] specified by the date (see help bk range).
−f
Normally, bk diff does not bother to diff against a checked out, read only file (unless a revision was specified). This option forces bk diff to ignore the read only hint and to do the diff against all specified files.

−F regex Only useful in unified diffs, the given regex will be matched with the lines before the diff block and, if a match is found, it will be printed after the ’@@’ at the start of the diff block. Typically used to match function declarations.
−h
Don’t print headers.
−H
Prefix diffs with the checkin comments of that range of revisions. The comments printed are those associated with the set difference of the two revisions.
−l
rev Show all changes made by the changeset containing rev rev. This obscure option is useful when there are multiple deltas in the same changeset and you aren’t sure of the changeset boundaries. Similar to

bk changes -ifile -vvrrev

−L[url] Show all the changes unique to this repository relative to the (outgoing) parent or url if one was specified. In this context, "changes" means committed, pending, and/or modified files. Very similar to:

bk -A diff -r@‘bk repogca [url]‘

−n Do RCS style diffs.
−-normal
Instead of unified diffs (the default) print less verbose diffs like those produced by diff(1).
−N
If a specified file is not under revision control treat it as if it were under revision control and the previous checked in version was empty. Without this option specified files not under revision control are listed as “New file: filename”.
−p
Procedural diffs, like diff −p.
−r
rev Diff revision rev. (Or key or changeset revision. See bk help terms under “rev argument.”)
−R
rev Show diffs between parent of rev and rev. If no revision is specified and the files are listed on standard input as file|rev then the revision is taken from the standard input.
−s
Display side-by-side diffs. The total width is controlled by the COLUMNS environment variable, and defaults to 80.
−−stats
Print a statistics header like diffstat in addition to the normal diff output.
−−stats−only
Print a statistics header like diffstat and suppress the normal diff output.
−S
−−standalone
Use with -L in a nested component when you want the component to act like a standalone repository.
−u
context Print unified diffs (this is the default). Optionally, pass the number of lines of context to print.
−v
Be verbose about non-matching ranges.
−w
Ignore white space when comparing lines.

EXAMPLES
You may diff specific revisions:

$ bk diff -r1.2..1.4 foo.c

When only one revision is supplied with −r, then that revision is compared to the working file or the top of trunk if the file is not edited.

A fairly useful thing is to show the differences introduced by a specific revision or changeset:

bk diff -R1.5 foo.c

Normally, the revisions specified mean the revision in the file. Changeset revisions do not match file revisions and sometimes you want to see the changes for a specific changeset. Both of these accomplish that:

bk diff -l@alpha1 file
bk changes -ifile -vvralpha1

To create a patch which captures all content changes as well as all new files:

bk -Axc diff -N

You can use bk diff to diff your entire tree, including edits against an existing changeset revision or tag in your repository.

$ bk -A diff
$ bk -A diff -r@rev

To see the diffs in the local tree from the new baseline cset in the parent (-L changes diff behavior to look at the whole tree):

$ bk diff -L

BUGS
This command does not currently handle displaying differences for binary files.

SEE ALSO
bk-changes, bk-difftool, bk-export, bk-range

CATEGORY
Common
File


Updated 2026-06-01 - jenkler.se | uex.se