-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
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:
- Open a file in a subdirectory (e.g.
api/) within a monorepo containing multiple.jj/roots. - Run
JJUI Log (Current File). - 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:
- lua/jjui.lua:jjui_filter_current_file()
function M.jjui_filter_current_file() ... local file = vim.fn.expand('%:p') if not utils.get_repo_root() then return end M.jjui('-r "files(' .. vim.fn.shellescape(vim.fn.fnamemodify(file, ':.')) .. ')"') end
- lua/jjui/utils.lua:get_repo_root()
- The path is constructed relative to current working directory, not repo root.
Additional notes:
JJUICurrentFiledoescdto the file's directory, butJJUIFilterCurrentFiledoes 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels