Skip to content

Support colocated jujutsu / git repositories #692

@devurandom

Description

@devurandom

Describe the bug

Since Jujutsu 0.34.0, jj will created colocated jj/git repositories (meaning both .jj/ and .git/ exist) by default: https://docs.jj-vcs.dev/latest/changelog/#0340-2025-10-01

treefmt however detects the repository type as git as soon as .git/ is present, ignoring the presence of .jj/:

treefmt/walk/walk.go

Lines 213 to 222 in 0a2f334

switch walkType {
case Auto:
// for now, we keep it simple and try git first, jujutsu second, and filesystem last
reader, err = NewReader(Git, root, path, db, statz)
if err != nil {
reader, err = NewReader(Jujutsu, root, path, db, statz)
if err != nil {
reader, err = NewReader(Filesystem, root, path, db, statz)
}
}

To Reproduce

Steps to reproduce the behavior:

  1. jj git clone ...
  2. Move around files
  3. Run treefmt and see it complain about "Path ... is in the worktree but appears to have been removed from the filesystem"

Expected behavior

treefmt detects colocated jj/git repositories as jj repositories.

System information

NixOS 25.11, jj 0.35.0, treefmt 2.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions