LinuxCommandLibrary

jj-simplify-parents

Simplify commit parents

TLDR

Simplify parent edges of given revisions

$ jj simplify-parents [[-r|--revisions]] [revsets]
copy

Simplify parent edges of given revisions and trees of their descendants
$ jj simplify-parents [[-s|--source]] [revsets]
copy

SYNOPSIS

jj simplify-parents [OPTIONS] [REVSET]...

PARAMETERS

-k, --keep <KEEP>...
    Keeps the given commit(s) explicit even if they can be made implicit

-r, --revision <REVISION>...
    The revisions whose parents to simplify (default: @)

-m, --message <MESSAGE>
    The new log message to use for the resulting commit

--no-edit
    Don't open an editor for the commit message

DESCRIPTION

The jj simplify-parents command is part of Jujutsu (jj), a Git-compatible version control system designed for efficient history rewriting. It rewrites the specified revisions (default: working-copy commit) to minimize explicit parents, making them implicit where possible. This linearizes the commit graph, reducing complexity without losing information, as implicit parents can always be restored.

Implicit parents are changes automatically inferred from the commit's content, similar to how jj handles automatic rebases. The command edits the commit message by default (opening an editor), but can use a provided message or skip editing. Use --keep to preserve specific parents explicitly. Ideal for cleaning up graphs after merges or temporary branches, it ensures a more readable history while preserving semantics.

This operation is non-destructive in jj's Git-backed model but rewrites history, so avoid on shared branches.

CAVEATS

Rewrites history irreversibly; use only on unpushed, non-shared commits. Back up with jj git export first. May change commit IDs, breaking references.

EXAMPLE

jj simplify-parents # Simplify working copy
jj simplify-parents -r foo # Simplify 'foo' commit

HISTORY

Introduced in Jujutsu 0.1.0 (2023) by Martin von Zweigbergk. Evolved to support advanced graph simplification in versions 0.18+ as jj gained traction for large repos.

SEE ALSO

Run jj simplify-parents --help for full details. Integrates with jj operations like jj op log to inspect changes.

SEE ALSO

jj rebase(1), jj squash(1), git rebase(1)

Copied to clipboard