jj-show
Show commit content
TLDR
Show commit description and changes in a revision
Show a summary of changes in a revision
Show a histogram of changes in a revision
SYNOPSIS
jj show [REVISION] [OPTIONS]
PARAMETERS
REVISION
Specifies the commit to display. This can be a commit ID prefix, a branch name, a tag, or any valid revset expression. If omitted, the command defaults to showing the working copy commit (@).
-n, --no-graph
Prevents the display of the commit graph alongside the commit details.
-s, --stats
Shows a summary of changes (lines added/deleted) for the commit, rather than the full diff content.
-p, --patch
Displays the full diff of the commit. This is the default behavior if no diff-related options are specified.
-P, --no-patch
Suppresses the display of the diff entirely, showing only the commit's metadata (author, message, etc.).
--color-words
Applies word-by-word coloring to the diff output, making it easier to spot granular changes within lines.
--tool <TOOL>
Uses a specified external diff tool (e.g., meld, vscode) to display the commit's changes.
--short
Provides a concise summary of the commit, typically including the commit ID, author, and the first line of the commit message.
--template <TEMPLATE>
Allows specifying a custom template string for formatting the command's output. Jujutsu uses a powerful template language for highly customizable views.
--from <REVISION>
When displaying the diff, calculates the changes relative to this specified REVISION, instead of the commit's parent.
--to <REVISION>
When displaying the diff, calculates the changes up to this specified REVISION, instead of the commit itself.
--pager <WHEN>
Controls when output is piped to a pager (e.g., less). Valid values are auto (default), always, or never.
--color <WHEN>
Controls when output uses colors. Valid values are auto (default), always, or never.
DESCRIPTION
The jj show command is a fundamental part of the Jujutsu (jj) distributed version control system, designed to display detailed information about a specific commit. When invoked without a specified revision, it defaults to showing the working copy commit (represented by @). This command provides a comprehensive view including the commit's diff (changes introduced), author and committer details, timestamps, and the commit message.
It serves a similar purpose to git show in Git, allowing users to review modifications and associated metadata before operations like merging, rebasing, or pushing. Its flexibility is enhanced by various options that can control the output format, ranging from showing only statistics to suppressing the diff entirely, or even formatting the output using a custom template.
CAVEATS
The jj show command is specific to the Jujutsu (jj) version control system and is not a standard Unix utility. Its REVISION argument utilizes Jujutsu's advanced revset language, which provides powerful but potentially complex ways to specify commits. Custom templates require familiarity with Jujutsu's templating syntax.
DEFAULT BEHAVIOR
When no REVISION is provided, jj show defaults to displaying information about the working copy commit (the commit that the current changes are based on, typically referred to as @). This makes it convenient to quickly inspect your current uncommitted changes or the state of your working directory.
REVISION SPECIFICATION
Jujutsu commands, including jj show, leverage a powerful 'revset' language for specifying commits. This allows for highly flexible and precise selection of revisions, such as 'branch_name', 'commit_id_prefix', '@' (working copy), 'main::' (all commits reachable from main), or combinations like 'branch_a - branch_b'.
HISTORY
Jujutsu (jj) is a modern, experimental distributed version control system developed by Martin von Zweigbergk, designed to offer a different approach to common VCS workflows, particularly around mutable history and collaboration. The jj show command is a core component from its early development, reflecting the system's emphasis on providing clear and flexible ways to inspect and understand changes within the repository. It aims to improve upon the usability and power found in traditional VCS tools like Git for certain operations.