Problem
detect-ref.sh (used by the Claude Code and Codex skills) is entirely git-based. Every command in the script (git rev-parse, git symbolic-ref, git status, git diff, etc.) fails in a jj repo, so the skill can't auto-detect the right ref to pass to revdiff.
Affects both copies:
.claude-plugin/skills/revdiff/scripts/detect-ref.sh
plugins/codex/skills/revdiff/scripts/detect-ref.sh
Suggested approach
Detect VCS the same way the Go code does (check for .jj before .git) and branch into jj equivalents:
| git |
jj equivalent |
git rev-parse --abbrev-ref HEAD |
jj log -r @ --no-graph -T 'bookmarks' or similar |
git status --porcelain |
jj status / jj diff --stat |
git diff --quiet |
jj diff --stat (empty = clean) |
git symbolic-ref refs/remotes/origin/HEAD |
jj bookmark list + heuristic for main |
Raised from PR #112 review feedback.
Problem
detect-ref.sh(used by the Claude Code and Codex skills) is entirely git-based. Every command in the script (git rev-parse,git symbolic-ref,git status,git diff, etc.) fails in a jj repo, so the skill can't auto-detect the right ref to pass to revdiff.Affects both copies:
.claude-plugin/skills/revdiff/scripts/detect-ref.shplugins/codex/skills/revdiff/scripts/detect-ref.shSuggested approach
Detect VCS the same way the Go code does (check for
.jjbefore.git) and branch into jj equivalents:git rev-parse --abbrev-ref HEADjj log -r @ --no-graph -T 'bookmarks'or similargit status --porcelainjj status/jj diff --statgit diff --quietjj diff --stat(empty = clean)git symbolic-ref refs/remotes/origin/HEADjj bookmark list+ heuristic for mainRaised from PR #112 review feedback.