@gw-tools/gw 0.59.1 → 0.60.0
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 +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -438,8 +438,12 @@ When creating a new worktree without specifying an existing branch, `gw checkout
|
|
|
438
438
|
|
|
439
439
|
3. **New branches**: If the branch doesn't exist anywhere, it's created from the source branch (defaultBranch or `--from` branch) after fetching the latest from remote.
|
|
440
440
|
|
|
441
|
+
**Remote Probe (catching teammates' pushes):**
|
|
442
|
+
When the requested branch isn't local, `gw checkout` queries the remote (`git ls-remote origin refs/heads/<branch>`) before deciding it's a brand-new branch. This catches branches a teammate just pushed that you haven't fetched yet — without it, `gw` would silently create a new branch with the same name from the default branch and you'd diverge. The probe uses a 3-second timeout and is silent on miss. Use `--no-fetch` to skip it (offline mode). The probe is also skipped automatically when you pass `-b`/`-B` or `--from`, since those signal you want a brand-new branch.
|
|
443
|
+
|
|
441
444
|
**Network Behavior:**
|
|
442
445
|
|
|
446
|
+
- **Branch not local**: Probes remote with `git ls-remote` (3s timeout, skipped with `--no-fetch`)
|
|
443
447
|
- **New branches without `--from`**: Fetches defaultBranch from remote, falls back to local if fetch fails (offline support)
|
|
444
448
|
- **New branches with `--from`**: Requires successful remote fetch, exits on failure (ensures fresh code)
|
|
445
449
|
- **Local branches**: Used directly without network access
|
|
@@ -471,6 +475,7 @@ If you try to add a worktree that already exists, the command will prompt you to
|
|
|
471
475
|
#### Options
|
|
472
476
|
|
|
473
477
|
- `--no-cd`: Don't navigate to the new worktree after creation
|
|
478
|
+
- `--no-fetch`: Skip the remote probe (offline mode); don't query origin for branches that aren't yet local
|
|
474
479
|
- `--from <branch>`: Create new branch from specified branch instead of `defaultBranch`
|
|
475
480
|
- `--from-staged`: Copy staged files from current worktree to new worktree (see [Staged Files](#staged-files))
|
|
476
481
|
|
|
@@ -1717,8 +1722,8 @@ nx run gw-tool:check
|
|
|
1717
1722
|
# Lint
|
|
1718
1723
|
nx run gw-tool:lint
|
|
1719
1724
|
|
|
1720
|
-
# Format code
|
|
1721
|
-
nx
|
|
1725
|
+
# Format code (Prettier; do NOT use `deno fmt`)
|
|
1726
|
+
nx format:write
|
|
1722
1727
|
|
|
1723
1728
|
# Compile to binary (current platform only)
|
|
1724
1729
|
nx run gw-tool:compile
|