Merge pull request 'Add Gitea PR skill and branch cleanup notes' (#22) from cursor/gitea-pr-skill into main
This commit was merged in pull request #22.
This commit is contained in:
@@ -11,6 +11,13 @@ After merging a pull request in this repository:
|
|||||||
2. Delete the **local** feature branch if it exists.
|
2. Delete the **local** feature branch if it exists.
|
||||||
3. Prune stale remote-tracking refs (`git fetch --prune` or equivalent).
|
3. Prune stale remote-tracking refs (`git fetch --prune` or equivalent).
|
||||||
|
|
||||||
Prefer in order: `tea pulls clean <pr>`, then Gitea API / `git push --delete`, then local `git branch -d`.
|
Prefer in order:
|
||||||
|
|
||||||
|
1. `tea pulls clean <pr> --ignore-sha` (may fail if tea expects HTTPS `origin`)
|
||||||
|
2. `git push origin --delete <feature-branch>` via SSH remote
|
||||||
|
3. `git branch -d <feature-branch>`
|
||||||
|
4. `git fetch --prune origin`
|
||||||
|
|
||||||
Do this automatically after every merge unless the user explicitly says to keep the branch.
|
Do this automatically after every merge unless the user explicitly says to keep the branch.
|
||||||
|
|
||||||
|
Full PR workflow (create/merge/push): see `.cursor/skills/gitea-prs/SKILL.md`.
|
||||||
|
|||||||
97
.cursor/skills/gitea-prs/SKILL.md
Normal file
97
.cursor/skills/gitea-prs/SKILL.md
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
---
|
||||||
|
name: gitea-prs
|
||||||
|
description: >-
|
||||||
|
Create, merge, and clean up pull requests on this repo's Gitea host using tea
|
||||||
|
and SSH. Use when the user asks to open a PR, create a pull request, merge a
|
||||||
|
PR, push a feature branch, or delete a feature branch after merge. Do not use
|
||||||
|
gh (GitHub CLI) for this repository.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Gitea pull requests (product-slip)
|
||||||
|
|
||||||
|
Host: `https://git.faryad.top/rhino/product-slip`
|
||||||
|
CLI: `tea` (login name `faryad`, user `rhino`)
|
||||||
|
Git remote: SSH on port **2222** (HTTPS push prompts for credentials and fails non-interactively).
|
||||||
|
|
||||||
|
```
|
||||||
|
origin ssh://git@git.faryad.top:2222/rhino/product-slip.git
|
||||||
|
```
|
||||||
|
|
||||||
|
If `origin` is still HTTPS, set SSH before push:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git remote set-url origin ssh://git@git.faryad.top:2222/rhino/product-slip.git
|
||||||
|
```
|
||||||
|
|
||||||
|
## Push feature branch
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git push -u origin HEAD
|
||||||
|
```
|
||||||
|
|
||||||
|
## Create PR
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tea pulls create \
|
||||||
|
--head <feature-branch> \
|
||||||
|
--base main \
|
||||||
|
--title "<short imperative title>" \
|
||||||
|
--description "$(cat <<'EOF'
|
||||||
|
## Summary
|
||||||
|
- <1-3 bullets>
|
||||||
|
|
||||||
|
## Test plan
|
||||||
|
- [ ] <checks>
|
||||||
|
EOF
|
||||||
|
)"
|
||||||
|
```
|
||||||
|
|
||||||
|
- Title: short, imperative (same style as commit messages; prefer under 20 words).
|
||||||
|
- Return the PR URL from tea output (e.g. `https://git.faryad.top/rhino/product-slip/pulls/N`).
|
||||||
|
|
||||||
|
### Draft PRs
|
||||||
|
|
||||||
|
`tea pulls create` has no `--draft` flag. This Gitea marks a PR as draft when the title starts with `WIP:` (API `draft: true` alone is ignored / cleared if the prefix is removed).
|
||||||
|
|
||||||
|
For a draft PR, either:
|
||||||
|
|
||||||
|
- Create with `--title "WIP: <title>"`, or
|
||||||
|
- `POST /api/v1/repos/rhino/product-slip/pulls` with `"draft": true` **and** a `WIP:` title (token from `tea` login in `~/.config/tea/config.yml`).
|
||||||
|
|
||||||
|
## Merge PR
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tea pulls merge <pr-index> --style merge
|
||||||
|
```
|
||||||
|
|
||||||
|
Then update local main:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git fetch --prune origin
|
||||||
|
git checkout main
|
||||||
|
git pull --ff-only origin main
|
||||||
|
```
|
||||||
|
|
||||||
|
## Delete feature branch after merge
|
||||||
|
|
||||||
|
Do this automatically after every merge unless the user says to keep the branch.
|
||||||
|
|
||||||
|
Prefer in order:
|
||||||
|
|
||||||
|
1. `tea pulls clean <pr-index> --ignore-sha`
|
||||||
|
(May fail if tea expects an HTTPS remote — fall through.)
|
||||||
|
2. Remote: `git push origin --delete <feature-branch>`
|
||||||
|
3. Local: `git branch -d <feature-branch>` (if still checked out elsewhere / still exists)
|
||||||
|
4. `git fetch --prune origin`
|
||||||
|
|
||||||
|
Confirm gone:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git ls-remote --heads origin '<feature-branch>'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Do not
|
||||||
|
|
||||||
|
- Use `gh` / GitHub APIs for this repo.
|
||||||
|
- Force-push `main`.
|
||||||
|
- Leave the feature branch on the remote after merge.
|
||||||
Reference in New Issue
Block a user