@gw-tools/gw 0.61.1 → 0.61.2-beta.70.2

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.
Files changed (2) hide show
  1. package/README.md +3 -49
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -832,7 +832,6 @@ When working in a worktree, you cannot easily checkout main to pull the latest c
832
832
  #### Options
833
833
 
834
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`)
836
835
  - `--remote <name>`: Specify remote name (default: "origin")
837
836
  - `-m, --merge`: Force merge strategy (overrides configured strategy)
838
837
  - `-r, --rebase`: Force rebase strategy (overrides configured strategy)
@@ -855,21 +854,9 @@ gw update --rebase
855
854
  # Update from a specific branch
856
855
  gw update --from develop
857
856
 
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
857
+ # Preview what would happen
868
858
  gw update --dry-run
869
859
 
870
- # Preview merge from a PR without executing
871
- gw update --from-pr 42 --dry-run
872
-
873
860
  # Force update even with uncommitted changes (not recommended)
874
861
  gw update --force
875
862
 
@@ -877,39 +864,6 @@ gw update --force
877
864
  gw update --remote upstream
878
865
  ```
879
866
 
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
-
913
867
  #### How It Works
914
868
 
915
869
  1. Fetches the latest version of the target branch from remote (e.g., `origin/main`)
@@ -927,7 +881,6 @@ Requirements:
927
881
 
928
882
  - 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.
929
883
  - 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.
931
884
 
932
885
  **Update strategy:**
933
886
 
@@ -1450,7 +1403,8 @@ The clean command:
1450
1403
  - By default, only removes worktrees with NO uncommitted changes
1451
1404
  - By default, only removes worktrees with NO unpushed commits
1452
1405
  - Always prompts for confirmation before deletion
1453
- - Main/bare repository, default branch, and gw_root worktrees are never removed
1406
+ - Bare repository, the configured `defaultBranch`, and `gw_root` are never removed
1407
+ - The canonical trunk names `main` and `master` are also always protected — even when one of them is not the currently configured `defaultBranch` (e.g. a repo with `defaultBranch: "master"` still protects a leftover local `main` branch, and vice versa)
1454
1408
  - After removing worktrees, automatically prunes orphan branches (branches with no worktree and no unpushed commits)
1455
1409
  - Use `--force` to bypass safety checks (use with caution)
1456
1410
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gw-tools/gw",
3
- "version": "0.61.1",
3
+ "version": "0.61.2-beta.70.2",
4
4
  "description": "A command-line tool for managing git worktrees - copy files between worktrees with ease",
5
5
  "keywords": [
6
6
  "git",