Skip to content

Add Jujutsu (jj) Support #3538

@jamespitt

Description

@jamespitt

Is your feature request related to a problem? Please describe.

As a developer using Jujutsu jj for version control, I've noticed that please currently only has native support for Git. While jj is often run with a Git repository, Please relies on the presence of the .git directory and executes Git commands directly for SCM-related features (like plz query changes, stamping with $SCM_REVISION, and garbage collection).

This can lead to subtle inconsistencies or require context switching if the user's primary workflow is entirely within jj, as Please will query the underlying Git state rather than the active Jujutsu working copy.

Describe the solution you'd like

I would like Please to natively support Jujutsu

The implementation should include:

  1. A new jj implementation in src/scm/jj.go that maps SCM interface methods to jj commands (e.g., jj log, jj diff, jj edit, etc.).
  2. Smart Detection for Colocated Repos: Since jj is frequently colocated with Git, scm.New() should intelligently detect which tool is the active primary interface.
  3. Generalization: Update existing Git-specific logs (e.g., in src/gc/gc.go) to be SCM-agnostic, and ensure .jj is ignored during repo exports (src/export/export.go).

Describe alternatives you've considered

  • Relying solely on the Git backend: Users can continue to use jj as a frontend for Git, but Please features might not perfectly reflect the virtual working copy state of jj without committing.
  • Configuring the SCM explicitly: Adding a .plzconfig option to force vcs = jj. While useful as an override, the automatic detection heuristic (comparing HEAD vs op_heads/heads) provides a seamless out-of-the-box experience for colocated users.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions