BK-DIFF(1)

📦 version 7.3.3, in alpine 3.24

💖 bk diff 💖

okay so bestie, this is the bk diff(none) page from the BitKeeper User’s Manual, and we’re about to make diffs make sense. 💅

✨ 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 💅

  • −Abdpru — 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 with 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.
  • −ddate — 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.
  • −lrev — 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.
  • −rrev — Diff revision rev. (Or key or changeset revision. See bk help terms under “rev argument.”)
  • −Rrev — 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.
  • −ucontext — 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

💖 sign-off: source/version/date energy from BitKeeper Inc, with tag 1E1, on the bk diff(none) page. byeee bestie, go diff something cute. 💖

📦 where this page comes from
  • alpine 3.24: bitkeeper-doc 7.3.3-r1 · Apache-2.0
  • 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms