# plan\_forge\_pull\_request\_merge

Read the merge methods a pull request's forge offers, whether its base branch allows each, and the commit message the forge would write for each.

read-only · idempotent · CLI only · [Forge](https://komrad.dev/latest/api/forge.md)

## Calling it

```bash
curl -X POST http://127.0.0.1:8787/komrad.forge.v1.ForgeService/PlanForgePullRequestMerge \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "<url>"
}'
```

```bash
komrad rpc plan-forge-pull-request-merge \
  --url '<string>'
```

## Request

### PlanForgePullRequestMergeRequest

| Field | Type | Description |
| --- | --- | --- |
| [`url`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-PlanForgePullRequestMergeRequest-url) | string\* at most 2048 characters | The pull request to plan, by web address. The address's host picks the forge connection. |

## Response

### PlanForgePullRequestMergeResponse

| Field | Type | Description |
| --- | --- | --- |
| [`options`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-PlanForgePullRequestMergeResponse-options) | [MergeOption\[\]](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeOption) | Every merge method the forge offers for the pull request, in the forge's order. |
| [`default_method`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-PlanForgePullRequestMergeResponse-default_method) | [MergeMethod](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeMethod) | The method the pull request merges by when a merge names none. |
| [`head_sha`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-PlanForgePullRequestMergeResponse-head_sha) | string | The pull request's head commit when the plan was read. |

## Types

### MergeOption

MergeOption is one way a pull request could merge.

| Field | Type | Description |
| --- | --- | --- |
| [`method`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeOption-method) | [MergeMethod](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeMethod) | The merge method. |
| [`allowed`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeOption-allowed) | bool | Whether the repository and the pull request's base branch allow the method. |
| [`message`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeOption-message) | [CommitMessage](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-CommitMessage) | The message the forge writes for the method by itself. Unset for a method that doesn't write a commit of its own. |

### CommitMessage

CommitMessage is the text of the commit a merge writes.

| Field | Type | Description |
| --- | --- | --- |
| [`headline`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-CommitMessage-headline) | string | The commit's first line. |
| [`body`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-CommitMessage-body) | string | The rest of the commit's message. Empty writes a headline alone. |

### MergeMethod

MergeMethod is how a pull request's commits land on its base branch.

| Value | Description |
| --- | --- |
| [`merge`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeMethod-merge) | The commits land under a merge commit. |
| [`squash`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeMethod-squash) | The commits land as one new commit. |
| [`rebase`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeMethod-rebase) | The commits are replayed onto the base branch one by one. |
| [`fast_forward`](https://komrad.dev/latest/api/forge/plan-forge-pull-request-merge.md#komrad-forge-v1-MergeMethod-fast_forward) | The base branch moves to the head commit, without a commit of its own. |
