Help us shape the future of Go! Take the 2026 Go Developer Survey

jj

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package jj replays revisions in a Jujutsu workspace (vcs.Replayer).

Index

Constants

View Source
const StateFile = "core-replay.json"

StateFile is the file in the workspace's .jj directory that holds a replay in progress.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replayer

type Replayer struct {
	// Bin is the jj executable; empty is "jj".
	Bin string
	// User and Email are who a replayed revision is committed by; empty
	// is "vcs replay" and "replay@localhost". The author is the original's.
	User, Email string
}

Replayer replays revisions in a Jujutsu workspace with `jj duplicate`: the originals and every bookmark stay where they are, and the replayed revisions are new changes, one per original, with the original's description and author. A duplicate has a change id of its own, so a replay reports each original beside its duplicate (vcs.Replay.Commits), and change ids, which are random, make no two replays alike.

jj records a conflict in the revision instead of stopping, so a replay always creates every revision. When one conflicts, the working copy is put on a new change on top of the first that does, where jj writes the conflict markers into the files; Continue squashes the caller's resolution into it, jj rebases the revisions above it, and the replay moves on to the next one that conflicts. A finished replay leaves the working copy on a new change on top of the candidate. The replay's state is kept in the workspace's .jj directory (StateFile).

The zero Replayer runs "jj" from PATH, with no user configuration of the caller's: jj is given a configuration of its own (JJ_CONFIG). It fetches and pushes nothing.

func (Replayer) Abort

func (j Replayer) Abort(ctx context.Context, ws vcs.Workspace) error

Abort abandons the replayed revisions, and the working copy on them, and returns the working copy to the change it was before the replay.

func (Replayer) Continue

func (j Replayer) Continue(ctx context.Context, ws vcs.Workspace) (vcs.Replay, error)

Continue squashes the working copy, the caller's resolution, into the replayed revision under it, and moves the working copy to the next one that conflicts, or finishes.

func (Replayer) Replay

func (j Replayer) Replay(ctx context.Context, ws vcs.Workspace, req vcs.ReplayRequest) (vcs.Replay, error)

Replay duplicates the revisions of req.OldBase..req.Head onto req.Onto.

func (Replayer) ReplayStatus

func (j Replayer) ReplayStatus(ctx context.Context, ws vcs.Workspace) (vcs.Replay, error)

ReplayStatus reads the replay in progress.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL