@gw-tools/gw 0.60.0 → 0.61.0-beta.68.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -196,8 +196,6 @@ The `install.sh` script links the planner + executor agent definitions and the a
|
|
|
196
196
|
- Run tests and iterate until passing
|
|
197
197
|
- Create draft PRs with full context
|
|
198
198
|
|
|
199
|
-
📦 **Building custom agents?** See [@gw-tools/autonomous-workflow-agent](https://www.npmjs.com/package/@gw-tools/autonomous-workflow-agent) for SDK integration.
|
|
200
|
-
|
|
201
199
|
📊 **Visualize progress in VS Code:** Install the [Agent Tasks extension](https://marketplace.visualstudio.com/items?itemName=mthines.agent-tasks) to see `plan.md`, `task.md`, and `walkthrough.md` artifacts live in the sidebar.
|
|
202
200
|
|
|
203
201
|
## Initial Setup: Secrets in the Default Branch
|
|
@@ -834,6 +832,7 @@ When working in a worktree, you cannot easily checkout main to pull the latest c
|
|
|
834
832
|
#### Options
|
|
835
833
|
|
|
836
834
|
- `--from <branch>`: Update from specified branch instead of defaultBranch (e.g., `--from develop`)
|
|
835
|
+
- `--from-pr <n|url>`: Update from a pull request by number or GitHub PR URL (mutually exclusive with `--from`)
|
|
837
836
|
- `--remote <name>`: Specify remote name (default: "origin")
|
|
838
837
|
- `-m, --merge`: Force merge strategy (overrides configured strategy)
|
|
839
838
|
- `-r, --rebase`: Force rebase strategy (overrides configured strategy)
|
|
@@ -856,9 +855,21 @@ gw update --rebase
|
|
|
856
855
|
# Update from a specific branch
|
|
857
856
|
gw update --from develop
|
|
858
857
|
|
|
859
|
-
#
|
|
858
|
+
# Update from a pull request (by number)
|
|
859
|
+
gw update --from-pr 42
|
|
860
|
+
|
|
861
|
+
# Update from a pull request (by GitHub URL)
|
|
862
|
+
gw update --from-pr https://github.com/owner/repo/pull/42
|
|
863
|
+
|
|
864
|
+
# Rebase onto a PR head instead of merging
|
|
865
|
+
gw update --from-pr 42 --rebase
|
|
866
|
+
|
|
867
|
+
# Preview what would happen without executing
|
|
860
868
|
gw update --dry-run
|
|
861
869
|
|
|
870
|
+
# Preview merge from a PR without executing
|
|
871
|
+
gw update --from-pr 42 --dry-run
|
|
872
|
+
|
|
862
873
|
# Force update even with uncommitted changes (not recommended)
|
|
863
874
|
gw update --force
|
|
864
875
|
|
|
@@ -866,6 +877,39 @@ gw update --force
|
|
|
866
877
|
gw update --remote upstream
|
|
867
878
|
```
|
|
868
879
|
|
|
880
|
+
#### Updating from a Pull Request (`--from-pr`)
|
|
881
|
+
|
|
882
|
+
The `--from-pr` flag lets you merge or rebase the current branch onto a PR's
|
|
883
|
+
head commit without checking out the PR branch. This is useful when you want
|
|
884
|
+
to test how your feature branch integrates with a colleague's PR that is still
|
|
885
|
+
in review.
|
|
886
|
+
|
|
887
|
+
```bash
|
|
888
|
+
# Merge PR #42 into the current worktree branch
|
|
889
|
+
gw update --from-pr 42
|
|
890
|
+
|
|
891
|
+
# Rebase the current branch onto PR #42
|
|
892
|
+
gw update --from-pr 42 --rebase
|
|
893
|
+
|
|
894
|
+
# Works with full GitHub URLs too (trailing paths and fragments are stripped)
|
|
895
|
+
gw update --from-pr https://github.com/owner/repo/pull/42/files
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
How it works:
|
|
899
|
+
|
|
900
|
+
1. Resolves the PR number from the bare number or GitHub URL
|
|
901
|
+
2. Guards against non-GitHub remotes (`--from-pr` requires a GitHub remote)
|
|
902
|
+
3. Force-fetches `refs/pull/<n>/head` into `refs/remotes/<remote>/pr/<n>`
|
|
903
|
+
(the `+` prefix ensures force-pushed PRs always overwrite stale cached refs)
|
|
904
|
+
4. Proceeds with the normal merge/rebase pipeline using the fetched ref
|
|
905
|
+
5. Optionally enriches the display label with the PR title via `gh` (silent if `gh` is absent or unauthenticated)
|
|
906
|
+
|
|
907
|
+
Requirements:
|
|
908
|
+
|
|
909
|
+
- A GitHub remote (the remote URL must contain `github.com`)
|
|
910
|
+
- Network access to fetch the PR ref
|
|
911
|
+
- `gh` CLI is **optional** — only used to show the PR title in output
|
|
912
|
+
|
|
869
913
|
#### How It Works
|
|
870
914
|
|
|
871
915
|
1. Fetches the latest version of the target branch from remote (e.g., `origin/main`)
|
|
@@ -883,6 +927,7 @@ gw update --remote upstream
|
|
|
883
927
|
|
|
884
928
|
- When using `--from` with an explicit branch, the command requires a successful fetch from the remote to ensure you're updating with the latest code. If the fetch fails (network issues, branch doesn't exist on remote, authentication problems), the command will exit with a detailed error message and suggestions for resolution.
|
|
885
929
|
- When no `--from` is specified (using default branch) or when no remote is configured, the command will warn about fetch failures but allow the update using the local branch.
|
|
930
|
+
- When using `--from-pr`, a successful fetch is always required. The command exits with a clear error message if the fetch fails.
|
|
886
931
|
|
|
887
932
|
**Update strategy:**
|
|
888
933
|
|