feat: support jj repos for repo inference and skill install - #324
Conversation
The CLI shelled out to git in two places: inferring owner/repo from the origin remote (bugs/rules/scans) and finding the repo root for skill installation. Both now fall back to jj when git fails, so non-colocated Jujutsu workspaces work (colocated ones already did via their .git directory). - rename src/utils/git.rs to src/utils/vcs.rs and share repo_root() between skill install and remote inference - fall back to `jj root` for the repo root and `jj git remote list` (parsed for the origin line) for remote inference - update help text, error messages, and embedded skill docs; regenerate docs/HELP.md Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Current Aviator status
This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
There was a problem hiding this comment.
1 issue found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/utils/vcs.rs">
<violation number="1" location="src/utils/vcs.rs:32">
P2: The non-colocated jj path hinges on `parse_jj_remote_list` matching `jj git remote list` output shaped exactly as `origin <url>` (single space, URL only, with nothing after it). The jj docs don't pin down this printed format, and the new tests only exercise hand-written fixtures of that same assumption rather than real jj output. If jj emits a different separator, an extra push-URL column, or additional fields on each line, the fallback silently yields None and inference fails with 'Could not infer repository from git or jj remotes.', defeating the purpose of this change. It'd be worth verifying the real output format (an integration test that shells out to `jj` when available, or a recorded real sample) and making the parse tolerant — e.g. splitting on whitespace and reading the second token instead of a literal `"origin "` prefix.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| /// which prints one `name url` pair per line. | ||
| fn parse_jj_remote_list(list: &str) -> Option<String> { | ||
| list.lines() | ||
| .find_map(|line| line.strip_prefix("origin ")) |
There was a problem hiding this comment.
P2: The non-colocated jj path hinges on parse_jj_remote_list matching jj git remote list output shaped exactly as origin <url> (single space, URL only, with nothing after it). The jj docs don't pin down this printed format, and the new tests only exercise hand-written fixtures of that same assumption rather than real jj output. If jj emits a different separator, an extra push-URL column, or additional fields on each line, the fallback silently yields None and inference fails with 'Could not infer repository from git or jj remotes.', defeating the purpose of this change. It'd be worth verifying the real output format (an integration test that shells out to jj when available, or a recorded real sample) and making the parse tolerant — e.g. splitting on whitespace and reading the second token instead of a literal "origin " prefix.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/utils/vcs.rs, line 32:
<comment>The non-colocated jj path hinges on `parse_jj_remote_list` matching `jj git remote list` output shaped exactly as `origin <url>` (single space, URL only, with nothing after it). The jj docs don't pin down this printed format, and the new tests only exercise hand-written fixtures of that same assumption rather than real jj output. If jj emits a different separator, an extra push-URL column, or additional fields on each line, the fallback silently yields None and inference fails with 'Could not infer repository from git or jj remotes.', defeating the purpose of this change. It'd be worth verifying the real output format (an integration test that shells out to `jj` when available, or a recorded real sample) and making the parse tolerant — e.g. splitting on whitespace and reading the second token instead of a literal `"origin "` prefix.</comment>
<file context>
@@ -1,6 +1,38 @@
+/// which prints one `name url` pair per line.
+fn parse_jj_remote_list(list: &str) -> Option<String> {
+ list.lines()
+ .find_map(|line| line.strip_prefix("origin "))
+ .map(|url| url.trim().to_string())
+}
</file context>
Bumps `detail-cli` to v0.2.9, following the `cut-release` skill (patch bump in `Cargo.toml` + `Cargo.lock`; `release.yml` tags `v0.2.9` and publishes the GitHub Release on merge to `main`). Changes since v0.2.8: - feat: support jj repos for repo inference and skill install (#324) `cargo check --locked` passes. [](https://app.indent.com/c/019fc658-5f4a-7964-a903-64dab3c4d82d) [](https://detail-dev.slack.com/archives/C0AEA3ACH5H/p1785738438774999?thread_ts=1785738438.774999&cid=C0AEA3ACH5H) Tag `@indent` to continue the conversation here. <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/usedetail/cli/pull/325" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open in Devin Review"> </picture> </a> <!-- devin-review-badge-end -->
The CLI shelled out to git in two places: inferring owner/repo from the origin remote (bugs/rules/scans) and finding the repo root for skill installation. Both now fall back to jj when git fails, so non-colocated Jujutsu workspaces work (colocated ones already did via their .git directory).
jj rootfor the repo root andjj git remote list(parsed for the origin line) for remote inferenceSummary by cubic
Adds Jujutsu (
jj) support for repo inference and skill install by falling back tojjwhengitcan’t provide data. This enables non-colocatedjjworkspaces and updates help text to say “git or jj”.New Features
owner/repofromjj git remote listwhengit remote get-url originfails.git rev-parse --show-toplevel, falling back tojj root.Refactors
src/utils/git.rstosrc/utils/vcs.rs; sharedrepo_root()andresolve_repo_arg()across commands.bugs,rules,scans, andskillcommands toutils::vcsand removed ad‑hoc git parsing fromskill.rs.Written for commit 7ed7cb2. Summary will update on new commits.