jj-log
Show commit history
TLDR
Show revision history as a graph
Show only given revsets (e.g. B::D, A..D, B|C|D, etc.)
Show log with a particular template for each line (e.g. 5 characters of commit hash and author)
SYNOPSIS
jj log [OPTIONS] [REVISIONS...]
PARAMETERS
--limit <COUNT>
Limit the number of commits displayed to COUNT.
--no-graph
Suppress drawing the commit graph in the output.
--patch
Show the full diff (patch) for each displayed commit.
--stat
Show a summary of changes (files added, deleted, modified) for each commit.
--template <TEMPLATE>
Use a custom template string to format the output of each commit. This offers extensive customization.
--revisions <EXPRESSION>
Filter commits based on a revset expression. This allows powerful selection of specific commits or ranges.
--branches
Show only commits that are local branches.
--remote-branches
Show only commits that are remote branches.
--tags
Show only commits that are tagged.
--glob <GLOB>
Filter commits by paths matching the given glob pattern.
--from-file <FILE>
Read revisions to display from the specified file.
--reversed
Display commits in reverse chronological order (oldest first).
--isolated
Do not show changes from descendant commits, showing only the direct commit's changes.
--merge-labels
Show merge labels on the graph edges to indicate merge directions.
--git
Format the output similar to Git's default log output.
DESCRIPTION
The jj-log command is a fundamental tool within the Jujutsu (jj) version control system, analogous to Git's git log. It provides a visual representation of the repository's commit history, displaying commits, their relationships (parents and children), and associated changes.
Unlike traditional VCS tools that might linearize history, jj-log excels at visualizing Jujutsu's explicit Directed Acyclic Graph (DAG) of commits. This is particularly useful in Jujutsu's rebase-centric workflow and with its mutable history model, allowing users to understand how commits have evolved and been rearranged. It helps in tracing the lineage of changes, identifying specific points in history, and navigating the complex landscape of a jj repository efficiently.
Its strength lies in its ability to present a clear, interactive graph of commits and its powerful filtering and formatting capabilities, making it indispensable for any Jujutsu user.
CAVEATS
Understanding Jujutsu's unique DAG structure and the revset language is key to effectively using jj-log's advanced features, particularly with its mutable history and rebase-centric workflow.
The default graphical output can be dense for large histories, requiring familiarity with its symbols or custom templating for clarity.
POWERFUL TEMPLATE ENGINE
One of jj-log's most distinctive features is its highly customizable output via the --template option. Users can define precise formatting using a rich template language, including access to commit metadata (ID, author, date, description) and graph drawing elements. This enables unparalleled flexibility to tailor the history view to specific needs, from simple one-line summaries to detailed, multi-line commit blocks.
REVSET LANGUAGE FOR FILTERING
The --revisions argument leverages Jujutsu's powerful "revset" language. This mini-language allows users to express complex queries for selecting sets of revisions, based on relationships (e.g., descendants, ancestors), branches, tags, or commit properties. This makes jj-log incredibly versatile for focused history exploration, debugging, or auditing specific parts of the commit graph.
HISTORY
jj-log is an intrinsic part of the Jujutsu version control system, initially developed by Martin Pool. Its design is deeply intertwined with Jujutsu's core philosophy of mutable history and an explicit, visual commit graph. It has evolved alongside the jj command set to provide a comprehensive and intuitive way to explore the repository's state and changes, reflecting Jujutsu's distinct approach to branching, rebasing, and history management.