A pull request proposes merging one branch of a repository (headBranch) into another
(baseBranch, the default branch unless set). It’s numbered in its repository: #1, #2, ….
Agents and people use the same pull requests: anyone with the actions can open, review, approve and
merge.
Open
In the console, Pull requests › New pull request on the repository’s page; with the CLI:
ezgh git prs create site --head agent/fix-header --title "Fix the header" --body "The title wrapped on phones."or CreatePullRequest. A draft (--draft) can’t be merged until
it’s marked ready. One pull request can be open between the same two branches (409 pull_exists).
New pushes to the head branch update it. Deleting the head branch closes it
(closedReason: "head_deleted").
Can it merge?
mergeable says whether it can merge now:
| Value | Means |
|---|---|
clean |
It can merge. |
blocked |
The base branch’s rule refuses it now, or it’s a draft. mergeableReason says which. |
conflicting |
Its changes conflict with the base branch: merge the base into the head branch and push. |
unknown |
It’s being worked out after a push. |
Review
ezgh git prs review site 12 --approve
ezgh git prs review site 12 --request-changes -m "Keep the logo on phones."A review (approve, request_changes or comment) is on the head commit at that moment. With
CreateReview, a review can also comment on lines: each comment has a
path, a line and a side, head for the new version’s line or base for the old one’s. A
comment stays on the commit it was made on; after new pushes it shows as outdated. Comments take
replies, and a thread can be resolved.
An approval counts toward a rule’s required approvals only from someone with git.pulls.approve on
the base branch who isn’t the pull request’s author and never pushed or committed to its head
branch.
Checks
EZGH Git runs nothing. A CI system, a Workflow or an agent with git.checks.write reports results on
a commit:
ezgh git checks report site 9f2c41e7b0a35d7c1e8f6a2b4c9d0e1f2a3b4c5d --name build --status success --summary "42 tests passed"status is queued, running, success, failure or cancelled; the latest report of a name by
the same reporter wins. A pull request shows the checks on its head commit.
Merge
ezgh git prs merge site 12 --method squash| Method | Result |
|---|---|
merge |
A merge commit with both parents |
squash |
One new commit with all the changes |
rebase |
The head’s commits replayed onto the base. Refused (409 rebase_unsupported) when they include a merge commit |
MergePullRequest takes method and expectedHeadSha, the head
you reviewed: if someone pushed since, it’s 409 head_moved and nothing is merged. Merging needs
git.pulls.merge on the base branch, a method both the repository and the base branch’s rule allow,
and whatever the rule requires (409 blocked_by_rule with the reason otherwise).