Summary
gh-observer currently assumes the user is working in a git repository and relies on gh pr view for auto-detecting the current PR. Users of jj (Jujutsu) — a Git-compatible VCS — may hit issues because jj's internal working copy model differs from git's, even though jj interoperates with git remotes.
Problem Areas
1. PR auto-detection fails (GetCurrentPR / GetCurrentPRWithRepo)
Both functions in internal/github/pr.go shell out to gh pr view --json number,url, which in turn inspects the current git branch. jj doesn't create a traditional git working tree or HEAD ref in the same way, so gh pr view may fail or return unexpected results.
GetCurrentPR() — line 32
GetCurrentPRWithRepo() — line 83
2. Remote URL parsing may fail
parseOwnerRepoFromURL() in internal/github/pr.go:106 reads git remote origin via the git config. jj can work without a traditional .git directory structure, so remote discovery could break.
3. Branch model assumptions
jj uses a "working copy commit" model instead of git branches. The concept of "current branch" maps differently, which affects any logic that assumes a 1:1 mapping between a branch name and a PR.
Suggested Approach
- Detect when running inside a jj repo (e.g., check for
.jj/ directory or jj on $PATH with jj root succeeding).
- When jj is detected, convert jj operations to equivalent git operations jj supports (e.g.,
jj git remote list instead of git remote -v, jj log to determine the current change/branch).
- Alternatively, support a fallback where the user can explicitly pass
--owner/repo or --pr-url when auto-detection fails (partially covered by existing positional args, but could be more ergonomic).
- Consider using jj's native
jj git subcommands where they map 1:1.
Workaround
Users can currently work around this by passing a full PR URL or PR number explicitly:
gh-observer https://github.com/owner/repo/pull/123
gh-observer 123
References
Summary
gh-observer currently assumes the user is working in a git repository and relies on
gh pr viewfor auto-detecting the current PR. Users of jj (Jujutsu) — a Git-compatible VCS — may hit issues because jj's internal working copy model differs from git's, even though jj interoperates with git remotes.Problem Areas
1. PR auto-detection fails (
GetCurrentPR/GetCurrentPRWithRepo)Both functions in
internal/github/pr.goshell out togh pr view --json number,url, which in turn inspects the current git branch. jj doesn't create a traditional git working tree or HEAD ref in the same way, sogh pr viewmay fail or return unexpected results.GetCurrentPR()— line 32GetCurrentPRWithRepo()— line 832. Remote URL parsing may fail
parseOwnerRepoFromURL()ininternal/github/pr.go:106readsgit remote originvia the git config. jj can work without a traditional.gitdirectory structure, so remote discovery could break.3. Branch model assumptions
jj uses a "working copy commit" model instead of git branches. The concept of "current branch" maps differently, which affects any logic that assumes a 1:1 mapping between a branch name and a PR.
Suggested Approach
.jj/directory orjjon$PATHwithjj rootsucceeding).jj git remote listinstead ofgit remote -v,jj logto determine the current change/branch).--owner/repoor--pr-urlwhen auto-detection fails (partially covered by existing positional args, but could be more ergonomic).jj gitsubcommands where they map 1:1.Workaround
Users can currently work around this by passing a full PR URL or PR number explicitly:
References