Skip to content

detect-ref.sh skill script is not jj-aware #114

Description

@nvahalik

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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