fix(skills): make git-workflow script paths portable
All four git-feature-* skills hardcoded /Users/torcsi/dev/kicad-wasm/ for
the helper-script invocations and one documentation example. That path
only resolved on the original author's machine — anyone else picking up
/git-feature-{start,commit,sync,finish} would hit "No such file or
directory" before the first pre-flight check ran.
Replaces the absolute paths with relative ones (`bash scripts/...`) and
rewrites the rebase-conflict handoff message in git-feature-sync.md to use
`git -C kicad ...` style instead of a hardcoded cd.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
8fd78d42b2
commit
9ab7158057
5 changed files with 10 additions and 10 deletions
|
|
@ -13,7 +13,7 @@ Optional positional message string. If omitted, ask the user for a message via `
|
|||
|
||||
## Steps
|
||||
|
||||
1. **Status snapshot.** Run `bash /Users/torcsi/dev/kicad-wasm/scripts/git-workflow/repo-status.sh` to see which repos have changes.
|
||||
1. **Status snapshot.** Run `bash scripts/git-workflow/repo-status.sh` to see which repos have changes.
|
||||
|
||||
2. **Show per-repo diff overview to the user first** (before any commit). For each repo, run:
|
||||
- `git -C <path> status --short`
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Per-repo main mapping is in `scripts/git-workflow/repos.sh` (root=`main`, subs=`
|
|||
|
||||
## Pre-flight (all of these must pass before any merge happens)
|
||||
|
||||
1. **Fetch every origin FIRST.** Run `bash /Users/torcsi/dev/kicad-wasm/scripts/git-workflow/for-each-repo.sh fetch origin`. This is mandatory and must happen *before* the status snapshot. `repo-status.sh` derives `up_to_date_with_main` from the local `origin/<main>` ref **without fetching** — so without this step a repo whose origin has moved looks "up to date", check 5 passes, and the staleness is only discovered mid-merge (the `pull --ff-only` in the steps below would catch it, but then you've already merged the earlier repos). Fetching here makes the pre-flight STOP cleanly with "run `/git-feature-sync` first" instead of bailing partway through.
|
||||
2. Run `bash /Users/torcsi/dev/kicad-wasm/scripts/git-workflow/repo-status.sh`. Parse the JSON. Because step 1 just fetched, `up_to_date_with_main` now reflects true remote state.
|
||||
1. **Fetch every origin FIRST.** Run `bash scripts/git-workflow/for-each-repo.sh fetch origin`. This is mandatory and must happen *before* the status snapshot. `repo-status.sh` derives `up_to_date_with_main` from the local `origin/<main>` ref **without fetching** — so without this step a repo whose origin has moved looks "up to date", check 5 passes, and the staleness is only discovered mid-merge (the `pull --ff-only` in the steps below would catch it, but then you've already merged the earlier repos). Fetching here makes the pre-flight STOP cleanly with "run `/git-feature-sync` first" instead of bailing partway through.
|
||||
2. Run `bash scripts/git-workflow/repo-status.sh`. Parse the JSON. Because step 1 just fetched, `up_to_date_with_main` now reflects true remote state.
|
||||
3. All 3 repos must have `dirty: false`. If any is dirty, STOP and tell the user to commit (`/git-feature-commit`) or stash first.
|
||||
4. All 3 repos must be on the same feature branch (use root's branch as the reference). If not, STOP and report the mismatch.
|
||||
5. All 3 repos must have `up_to_date_with_main: true` (i.e. the feature is rebased onto the latest main). If any isn't, STOP and instruct: "run `/git-feature-sync` first".
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ If the user invoked the skill without a branch name, ask for one via `AskUserQue
|
|||
|
||||
## Steps
|
||||
|
||||
1. **Pre-flight: assert all 3 repos are clean.** Run `bash /Users/torcsi/dev/kicad-wasm/scripts/git-workflow/assert-clean.sh`. If it exits non-zero, STOP and tell the user which repos are dirty and that they need to commit, stash, or discard before starting a new feature.
|
||||
1. **Pre-flight: assert all 3 repos are clean.** Run `bash scripts/git-workflow/assert-clean.sh`. If it exits non-zero, STOP and tell the user which repos are dirty and that they need to commit, stash, or discard before starting a new feature.
|
||||
|
||||
2. **Pre-flight: check no repo is already on a non-main branch.** Run `bash /Users/torcsi/dev/kicad-wasm/scripts/git-workflow/repo-status.sh` and inspect each line's `branch` field. If any repo's `branch` is not its `main` (or is empty meaning detached HEAD), STOP and tell the user. Suggest: `/git-feature-sync` if they're already mid-feature, or manually checkout the main in that repo first. Do NOT silently switch off in-progress work.
|
||||
2. **Pre-flight: check no repo is already on a non-main branch.** Run `bash scripts/git-workflow/repo-status.sh` and inspect each line's `branch` field. If any repo's `branch` is not its `main` (or is empty meaning detached HEAD), STOP and tell the user. Suggest: `/git-feature-sync` if they're already mid-feature, or manually checkout the main in that repo first. Do NOT silently switch off in-progress work.
|
||||
|
||||
3. **For each repo** in order [root, kicad, wxwidgets], run these commands. Echo what you're about to do in chat before each repo.
|
||||
- `git -C <path> fetch origin`
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ So after the user resolves a conflict manually + runs `git rebase --continue` in
|
|||
|
||||
## Steps
|
||||
|
||||
1. **Fetch every origin FIRST.** Run `bash /Users/torcsi/dev/kicad-wasm/scripts/git-workflow/for-each-repo.sh fetch origin`. This is mandatory on every sync and must happen *before* the status snapshot. `repo-status.sh` derives `up_to_date_with_main` from the local `origin/<main>` ref **without fetching** — so without this step the work plan (step 4) can wrongly mark a repo "up to date" and skip a needed rebase when its origin has moved. (This is the bug that let a stale sync report "all 3 up to date" while `origin/wasm-port` had actually advanced.)
|
||||
1. **Fetch every origin FIRST.** Run `bash scripts/git-workflow/for-each-repo.sh fetch origin`. This is mandatory on every sync and must happen *before* the status snapshot. `repo-status.sh` derives `up_to_date_with_main` from the local `origin/<main>` ref **without fetching** — so without this step the work plan (step 4) can wrongly mark a repo "up to date" and skip a needed rebase when its origin has moved. (This is the bug that let a stale sync report "all 3 up to date" while `origin/wasm-port` had actually advanced.)
|
||||
|
||||
2. **Get status snapshot.** Run `bash /Users/torcsi/dev/kicad-wasm/scripts/git-workflow/repo-status.sh` and parse the per-repo JSON. Because step 1 just fetched, `up_to_date_with_main` now reflects true remote state.
|
||||
2. **Get status snapshot.** Run `bash scripts/git-workflow/repo-status.sh` and parse the per-repo JSON. Because step 1 just fetched, `up_to_date_with_main` now reflects true remote state.
|
||||
|
||||
3. **Pre-flight checks.**
|
||||
- If any repo has `rebase_in_progress: true`, STOP. Tell the user which repo, and that they need to resolve (`git -C <repo> rebase --continue` after `git add`-ing resolved files) or abort (`git -C <repo> rebase --abort`) before sync can proceed.
|
||||
|
|
@ -56,7 +56,7 @@ When a rebase fails mid-flight in repo X, list the repos in the plan, what's bee
|
|||
>
|
||||
> **To resolve manually:**
|
||||
> ```
|
||||
> cd /Users/torcsi/dev/kicad-wasm/kicad
|
||||
> cd kicad # from the project root
|
||||
> # edit each conflicted file, resolve <<<<<<< markers
|
||||
> git add eeschema/foo.cpp common/bar.cpp
|
||||
> git rebase --continue
|
||||
|
|
@ -64,7 +64,7 @@ When a rebase fails mid-flight in repo X, list the repos in the plan, what's bee
|
|||
>
|
||||
> Then re-run `/git-feature-sync` — kicad will be detected as already rebased and it will proceed with wxwidgets.
|
||||
>
|
||||
> To roll back kicad only: `cd /Users/torcsi/dev/kicad-wasm/kicad && git rebase --abort`. Note: already-rebased repos (root in this case) **stay rebased** — they are not rolled back.
|
||||
> To roll back kicad only: `git -C kicad rebase --abort`. Note: already-rebased repos (root in this case) **stay rebased** — they are not rolled back.
|
||||
|
||||
Get the conflicted-files list from `git -C <path> diff --name-only --diff-filter=U`.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# Sourced library. Single source of truth for the 3-repo layout.
|
||||
# Usage: source "$(dirname "$0")/repos.sh"
|
||||
|
||||
ROOT_DIR="/Users/torcsi/dev/kicad-wasm"
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
|
||||
REPOS=(root kicad wxwidgets)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue