Skip to content

JJUI Log (Current File) revset is incorrect in monorepos: path is resolved from project dir, not nearest .jj/ directory #2

@Straffern

Description

@Straffern

Summary:
When using JJUI Log (Current File) within a monorepo or workspace, the generated revset/fileset uses Neovim's working directory as the base rather than the nearest .jj/ directory. This causes issues when the project contains multiple projects/repositories or workspace roots, as logs may be run from the wrong context.

Steps to reproduce:

  1. Open a file in a subdirectory (e.g. api/) within a monorepo containing multiple .jj/ roots.
  2. Run JJUI Log (Current File).
  3. Observe that the log revset is built using the project dir instead of the closest .jj/ root.

Expected behavior:

  • The revset/fileset should always use the path relative to the closest .jj/ directory (repo root), not Neovim's project dir.
  • This behavior should also support workspaces.

Relevant code:

Additional notes:

  • JJUICurrentFile does cd to the file's directory, but JJUIFilterCurrentFile does not normalize to repo root.
  • Supports monorepo and workspace workflows if adjusted.

Proposed fix:

  • Use get_repo_root() to detect the nearest .jj/ directory and make the fileset path relative to it.
  • If possible, align revset construction for JJUI Log (Current File) with repo root resolution logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions