Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106---title: Pull requestsdescription: Propose changes on a branch, review them round by round, and merge them.---
import PullSelectors from "../../../components/PullSelectors.svelte";
A pull request is a proposal to merge one branch into another branch. Ittells other people about the changes that you pushed to a branch. Otherpeople can discuss the changes and review them. You can add more commitsbefore you merge the changes into the target branch.
On Tangled, a pull request is a series of immutable **rounds**. When youcreate a pull request, Tangled makes round 0. To update the pullrequest, push to the same branch and select **Resubmit**. This makes anew round. Each round records a fixed base commit and a fixed headcommit. Reviewers can read earlier rounds. Thus they can see how thepull request changes. A round cannot be modified once created, you canonly submit a new round.
## Opening a pull request
The **New pull** page (`/pulls/new`) asks for a source branch, a targetbranch, a title, and a body in markdown. The target branch is thedefault branch, unless you select a different branch. You cannot use thedefault branch as the source.
The page shows the commits that the pull request includes, and the diffagainst the target branch.
When you push a branch that is not the default branch, the push outputincludes a link. The link opens the form with the two branches alreadycorrect:
```shgit push origin fix-parser```
The link has this form:
`https://tangled.org/alice.tngl.sh/my-project/pulls/new?source=branch&sourceBranch=fix-parser&targetBranch=main`
When you submit the form, Tangled creates the pull request and its firstround, round 0. Round 0 records the merge base of the two branches andthe tip of the source branch.
## Rounds
Each round holds a base commit and a head commit. You cannot edit around after Tangled creates it.
This separates work on a branch from a request for review. You can pushfixups, squash, and rebase as often as you want. These actions do notchange what the reviewers read. When the branch is ready, submit a newround. Earlier rounds stay available, together with the discussion thatoccurred while they were current.
## Reviewing
Every round of a pull request has a URL. Thus you can send a reviewer alink to the exact view that you want. Since rounds are immutable,reviewers can always drop comments without them being outdated by anupdate to the PR.
## Interdiffs and JJ VCS
As your PR evolves, reviewers might want to only review the part of thePR that has changed across versions. To enable this form of review,Tangled has native support for interdiff-style reviews:
- First, you must use the Jujustu version control system to manage your repository- All commits in your PR must have [Jujutsu change-ids](https://docs.jj-vcs.dev/latest/glossary/#change-id) associated with them
When you submit a second version to your PR, you will see all submittedversions in a version selector dropdown, here, you can use use<kbd>Shift</kbd> + <kbd>Left Click</kbd> to compare against a previousversion, and Tangled will calculate an interdiff to show you exactlywhat changed between the two rounds.
Tangled also shows Jujutsu change-ids across the UI if commits have anassociated change-id header.
<PullSelectors client:visible />
## Merging
The merge box checks the newest round against the current tip of thetarget branch. It reports if the round applies cleanly. The repositoryowner and the collaborators can then select **Merge**. Several mergestrategies are also available to choose from.
## URLs
| Path | Shows || ------------------------------------------------------- | --------------------------------------------- || `/<owner>/<repo>/pulls/<id>` | A pull request, at its newest round || `/<owner>/<repo>/pulls/<id>/latest` | The newest round || `/<owner>/<repo>/pulls/<id>/<round>` | One round || `/<owner>/<repo>/pulls/<id>/<round>/<commit>..<commit>` | A range of commits in a round || `/<owner>/<repo>/pulls/<id>/<from>..<to>` | The interdiff between two rounds || `/<owner>/<repo>/pulls/<id>/<from>..<to>/<change-id>` | That interdiff narrowed to one Jujutsu change |