Skip to content

feat: support jj repos for repo inference and skill install - #324

Merged
drob merged 1 commit into
usedetail:mainfrom
dbt:jj-support
Aug 3, 2026
Merged

feat: support jj repos for repo inference and skill install#324
drob merged 1 commit into
usedetail:mainfrom
dbt:jj-support

Conversation

@dbt

@dbt dbt commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

Open in Devin Review

Summary by cubic

Adds Jujutsu (jj) support for repo inference and skill install by falling back to jj when git can’t provide data. This enables non-colocated jj workspaces and updates help text to say “git or jj”.

  • New Features

    • Infer owner/repo from jj git remote list when git remote get-url origin fails.
    • Find repo root via git rev-parse --show-toplevel, falling back to jj root.
    • Updated CLI help and embedded skills to mention inference from “git or jj” remotes.
  • Refactors

    • Moved src/utils/git.rs to src/utils/vcs.rs; shared repo_root() and resolve_repo_arg() across commands.
    • Switched bugs, rules, scans, and skill commands to utils::vcs and removed ad‑hoc git parsing from skill.rs.

Written for commit 7ed7cb2. Summary will update on new commits.

Review in cubic

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>
@aviator-app

aviator-app Bot commented Aug 3, 2026

Copy link
Copy Markdown

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/utils/vcs.rs
/// 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 "))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@drob
drob enabled auto-merge (squash) August 3, 2026 06:26
@drob
drob merged commit 9b815d7 into usedetail:main Aug 3, 2026
14 checks passed
@drob drob mentioned this pull request Aug 3, 2026
drob added a commit that referenced this pull request Aug 3, 2026
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.

[![View in
Indent](https://assets.indent.com/view-in-indent.svg)](https://app.indent.com/c/019fc658-5f4a-7964-a903-64dab3c4d82d)
[![View in
Slack](https://assets.indent.com/slack-thread.svg)](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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants