diff | d
show differences between commits
Show the differences between two commits. If only one commit is specified, show the differences between the specified commit and your working copy. If no commits are specified, show your pending changes.
-c to see the changes in the specified commit relative to its
By default, this command skips binary files. To override this behavior,
-a to include binary files in the diff.
By default, diffs are shown using the unified diff format. Specify
to generate diffs in the git extended diff format. For more information,
sl help diffs.
sl diff might generate unexpected results during merges because it
defaults to comparing against your working copy's first parent commit
if no commits are specified.
- compare a file in the current working directory to its parent:
sl diff foo.c
- compare two historical versions of a directory, with rename info:
sl diff --git -r 5be761874:431ec8e07 lib/
- get change stats relative to the last change on some date:
sl diff --stat -r "date('may 2')"
- diff all newly-added files that contain a keyword:
sl diff "set:added() and grep(GNU)"
- compare a revision and its parents:
sl diff -c 340f3fef5 # compare against first parent
sl diff -r 340f3fef5^:340f3fef5 # same using revset syntax
sl diff -r 340f3fef5^2:340f3fef5 # compare against the second parent
Returns 0 on success.
|change made by revision|
|treat all files as text|
|use git extended diff format|
|generate binary diffs in git mode (default)|
|omit dates from diff headers|
|omit a/ and b/ prefixes from filenames|
|show which function each change is in|
|produce a diff that undoes the changes|
|ignore white space when comparing lines|
|ignore changes in the amount of white space|
|ignore changes whose lines are all blank|
|ignore changes in whitespace at EOL|
|number of lines of context to show|
|output diffstat-style summary of changes|
|produce diffs relative to subdirectory|
|only show changes for files modified in the requested revisions|
|include files matching the given patterns|
|exclude files matching the given patterns|
|only show changes in files in the sparse config|