Skip to content

feat(git-wait): add -C DIR to target another repo - #224

Merged
st0nefish-ci[bot] merged 1 commit into
masterfrom
worktree-wip-git-wait-target-repo
Oct 9, 2026
Merged

st0nefish-ci[bot] merged 1 commit into
masterfrom
worktree-wip-git-wait-target-repo

Conversation

@St0nefish

Copy link
Copy Markdown
Owner

Summary

  • New global -C DIR (alias --repo-dir DIR) flag for git-wait, placed before the command, so it can run against a repo other than the current directory without a caller-side cd. The cd happens inside the script's own process, so platform detection, pr wait, run watch and the underlying gh/tea calls all follow the target repo. Without the flag, behavior is unchanged.
  • A missing value, a non-directory, or a non-git directory gives a usage error (exit 1).
  • The script path is resolved before the cd, so --help still works after -C.
  • git-tools SKILL.md gets a "Targeting another repo" section.
  • Vendored copies re-synced into git-tools and session; versions bumped to git-tools 3.4.0 and session 4.9.2 (claude and copilot).

Review

/code-review medium --fix ran and found one bug, now fixed: a relative $0 broke --help after -C. Not fixed, as out of scope:

  • --help outside a repo fails because platform detection runs first. This was already true before this change.
  • -C is parsed only as the first argument, and only once. This is documented.

Only git-wait honors -C. Direct gh/tea calls against another repo still need their own -R / --repo. The new SKILL.md section says so.

Test plan

  • bash tests/git-wait/test-target-repo.sh — 7 new tests (GitHub and Gitea origins, run from an unrelated cwd; alias; subcommand composition; three validation errors)
  • bash .github/scripts/validate-all.sh — all checks pass
  • -C <dir> --help was not exercised by a test; the sandbox blocked running it

🤖 Generated with Claude Code

Lets callers run git-wait against a repo other than the current directory
without a caller-side cd. The cd happens inside the script's own process, so
platform detection, pr wait, run watch and the gh/tea calls all follow the
target repo.

- utils/git-wait: global -C DIR / --repo-dir DIR flag, validated before platform detection
- resolve the script path before the cd so --help still works
- git-tools SKILL.md: document targeting another repo
- tests/git-wait/test-target-repo.sh: cover both platforms, alias, subcommand composition and validation errors
- re-vendor git-wait into git-tools and session
- bump git-tools to 3.4.0 and session to 4.9.2 (claude and copilot)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@st0nefish-ci
st0nefish-ci Bot enabled auto-merge October 9, 2026 16:23
@st0nefish-ci
st0nefish-ci Bot merged commit a13d2ff into master Oct 9, 2026
8 checks passed
@st0nefish-ci
st0nefish-ci Bot deleted the worktree-wip-git-wait-target-repo branch October 9, 2026 16:28
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.

1 participant