You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for Gitea pull requests via the new `gpr:<number>` syntax.
- Introduce `GiteaProvider` and `src/git/remote_ref/gitea.rs` to fetch PR metadata via the `tea` CLI.
- Add `PlatformData::Gitea` and wire Gitea handling into remote-ref resolution and branch creation logic.
- Expose `GiteaProvider` from `remote_ref` module and update PR remote discovery to handle GitHub/Gitea.
- Teach switch command parsing to accept `gpr:` shortcuts and update CLI docs/help text.
- Surface CLI syntax in error messages by adding `syntax` to relevant `GitError` variants.
- Add integration tests and snapshots for `gpr:` behavior, and unit tests for Gitea parsing helpers.
- Documentation updates to reference `gpr:` and note `tea` CLI requirement.
No breaking changes. The `gpr:` flow requires the `tea` CLI to be installed and authenticated.
wt switch --create fix --base=@ # Branch from current HEAD
73
75
wt switch pr:123 # PR #123's branch
76
+
wt switch gpr:123 # Gitea PR #123's branch
74
77
wt switch mr:101 # MR !101's branch
75
78
```
76
79
@@ -128,6 +131,18 @@ Requires `gh` CLI to be installed and authenticated. The `--create` flag cannot
128
131
129
132
**Fork PRs:** The local branch uses the PR's branch name directly (e.g., `feature-fix`), so `git push` works normally. If a local branch with that name already exists tracking something else, rename it first.
130
133
134
+
## Gitea pull requests
135
+
136
+
The `gpr:<number>` syntax resolves the branch for a Gitea pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches `refs/pull/N/head` and configures `pushRemote` to the fork URL.
137
+
138
+
```bash
139
+
wt switch gpr:101 # Checkout Gitea PR #101
140
+
```
141
+
142
+
Requires `tea` CLI to be installed and authenticated. The `--create` flag cannot be used with `gpr:` syntax since the branch already exists.
143
+
144
+
**Fork PRs:** The local branch uses the PR's branch name directly, so `git push` works normally. If a local branch with that name already exists tracking something else, rename it first.
145
+
131
146
## GitLab merge requests
132
147
133
148
The `mr:<number>` syntax resolves the branch for a GitLab merge request. For same-project MRs, it switches to the branch directly. For fork MRs, it fetches `refs/merge-requests/N/head` and configures `pushRemote` to the fork URL.
wt switch --create fix --base=@ # Branch from current HEAD
57
59
wt switch pr:123 # PR #123's branch
60
+
wt switch gpr:123 # Gitea PR #123's branch
58
61
wt switch mr:101 # MR !101's branch
59
62
```
60
63
@@ -105,6 +108,18 @@ Requires `gh` CLI to be installed and authenticated. The `--create` flag cannot
105
108
106
109
**Fork PRs:** The local branch uses the PR's branch name directly (e.g., `feature-fix`), so `git push` works normally. If a local branch with that name already exists tracking something else, rename it first.
107
110
111
+
## Gitea pull requests
112
+
113
+
The `gpr:<number>` syntax resolves the branch for a Gitea pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches `refs/pull/N/head` and configures `pushRemote` to the fork URL.
114
+
115
+
```bash
116
+
wt switch gpr:101 # Checkout Gitea PR #101
117
+
```
118
+
119
+
Requires `tea` CLI to be installed and authenticated. The `--create` flag cannot be used with `gpr:` syntax since the branch already exists.
120
+
121
+
**Fork PRs:** The local branch uses the PR's branch name directly, so `git push` works normally. If a local branch with that name already exists tracking something else, rename it first.
122
+
108
123
## GitLab merge requests
109
124
110
125
The `mr:<number>` syntax resolves the branch for a GitLab merge request. For same-project MRs, it switches to the branch directly. For fork MRs, it fetches `refs/merge-requests/N/head` and configures `pushRemote` to the fork URL.
wt switch --create fix --base=@ # Branch from current HEAD
305
307
wt switch pr:123 # PR #123's branch
308
+
wt switch gpr:123 # Gitea PR #123's branch
306
309
wt switch mr:101 # MR !101's branch
307
310
```
308
311
@@ -354,6 +357,18 @@ Requires `gh` CLI to be installed and authenticated. The `--create` flag cannot
354
357
355
358
**Fork PRs:** The local branch uses the PR's branch name directly (e.g., `feature-fix`), so `git push` works normally. If a local branch with that name already exists tracking something else, rename it first.
356
359
360
+
## Gitea pull requests
361
+
362
+
The `gpr:<number>` syntax resolves the branch for a Gitea pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches `refs/pull/N/head` and configures `pushRemote` to the fork URL.
363
+
364
+
```console
365
+
wt switch gpr:101 # Checkout Gitea PR #101
366
+
```
367
+
368
+
Requires `tea` CLI to be installed and authenticated. The `--create` flag cannot be used with `gpr:` syntax since the branch already exists.
369
+
370
+
**Fork PRs:** The local branch uses the PR's branch name directly, so `git push` works normally. If a local branch with that name already exists tracking something else, rename it first.
371
+
357
372
## GitLab merge requests
358
373
359
374
The `mr:<number>` syntax resolves the branch for a GitLab merge request. For same-project MRs, it switches to the branch directly. For fork MRs, it fetches `refs/merge-requests/N/head` and configures `pushRemote` to the fork URL.
@@ -385,7 +400,7 @@ To change which branch a worktree is on, use `git switch` inside that worktree.
0 commit comments