Unverified 提交 0ab62856 authored 作者: wwwillchen-bot's avatar wwwillchen-bot 提交者: GitHub

docs: record empty-branch PR workflow note (#3065)

## Summary - document that `git rev-list --left-right --count upstream/main...HEAD` returning `0 0` means the branch cannot produce a PR - note that agents should report the branch as pushed but PR-blocked instead of creating an empty commit just to satisfy `gh pr create` - update the git workflow rules with this edge case ## Test plan - npm run fmt - npm run lint:fix - npm run ts - npm test #skip-bugbot 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/3065" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> Co-authored-by: 's avatarWill Chen <7344640+wwwillchen@users.noreply.github.com>
上级 871e3b41
......@@ -24,6 +24,16 @@ gh pr create --head <owner>:<branch> ...
This can happen when remotes are configured in a non-fork layout and `gh` fails to infer the branch mapping.
## Empty branches cannot produce PRs
Before creating a PR for a freshly pushed branch, check whether it is actually ahead of the base branch:
```bash
git rev-list --left-right --count upstream/main...HEAD
```
If this returns `0 0`, the branch has no commits ahead of `upstream/main`. GitHub cannot open a PR for an empty branch, so do not fabricate an empty commit just to satisfy `gh pr create`; report the branch as pushed but PR-blocked instead.
## `gh pr create` body quoting
When passing a PR body inline via `gh pr create --body "..."`, unescaped backticks are evaluated by `zsh` before `gh` runs. Avoid backticks in inline bodies, or use a body file / heredoc so literal code identifiers do not turn into `command not found` errors.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论