Stacks
Stack merge requests and navigation
5 min read
In a stack, each branch has its own merge request, and the target of each one is the branch below.
That way, !11 of feature/b shows only the commits of feature/b, not those of feature/a.
Versora creates the merge request with that target already set and writes the stack navigation in
each one's description, so the reviewer knows where they are.
On this page, "merge request" also covers the GitHub pull request. On GitHub, the app's texts say
"pull request" and the number starts with #.
- Branch menu › Branch stack › Create stack merge request for feature/b…
- Stack header in the STACKS section: right-click › the same item, for the current branch (or the lowest one).
- Palette (Ctrl+P): "Create stack merge request…" (detail: "feature/b → feature/a").
When the branch already has a merge request, the item becomes "This branch already has !11" and is disabled. In the palette, the command appears as unavailable: "the branch already has a merge request". Without GitLab or GitHub set up: "no GitLab/GitHub set up".
- Choose Create stack merge request for feature/b…
- If the branch below (
feature/a) isn't on the remote yet, the merge request has nothing to target. The Push the stack before the merge request? dialog opens, with the message "The branch below (feature/a) isn't on origin yet: the merge request needs it as its target. Push the stack, then create the merge request." The Push the stack button opens the stack push. Then ask for the merge request again. - With the parent on the remote, the usual Create merge request form opens, with Target
already set to
feature/a. Iffeature/bisn't on the remote, or is ahead of it, the form comes with the push checked. - Fill it in and create it, as in Create merge request. Title, description, template, draft and reviewers work the same way.
- Right after creating it, if the navigation is turned on, Versora updates the stack navigation in the descriptions.
If the branch already has a merge request, you see "feature/b already has merge request !11." with the Open the review button.
- The target is the parent's name on the remote.
- The merge request is created through the GitLab or GitHub API, as in the ordinary form. The push,
if checked, is an ordinary
git pushoffeature/b.
With the navigation turned on, each merge request in the stack gets a block at the end of the description:
<!-- versora-stack -->
**Stack:** !10 → **!11** → !12
<!-- /versora-stack -->
- The current merge request appears in bold.
- A stack branch that doesn't have a merge request yet appears by name, in backticks.
- Versora only touches the part between the two comments: the text you wrote in the description isn't touched. Updating replaces only the block; being left with a single branch removes the block.
The block is written:
- when you create the merge request of a stacked branch;
- when you sync the stack and after a reorder, fold or split with retargeting;
- when you ask for it, with Update the navigation in the merge requests.
- Branch menu › Branch stack › Update the navigation in the merge requests.
- Palette: "Update the navigation in the stack merge requests" (detail: ""Stack: !10 → !11 → !12" in each description").
Possible notices:
- "Stack navigation updated in 2 merge requests." or "The stack navigation was already up to date in the merge requests.";
- "No merge request in the stack to update.": no branch has a merge request yet;
- "Couldn't update the stack navigation in: …": lists the merge requests that failed and the reason (for example, no permission to edit the description).
GitLab 19.1 or newer and GitHub (stacked pull requests) show the stack by themselves: GitLab puts "1 of N" in each merge request header and retargets the one above after the one below is merged (when the source branch is deleted on merge). GitHub rebases the stack on the server and retargets the one above after the merge.
Versora notices when the server recognizes the stack and shows the cloud badge: just the icon in the stack header in the STACKS section, and "also on GitLab" (or "also on GitHub") in the review navigation.
For GitLab, Versora considers the stack recognized when:
- the server is 19.1 or newer;
- the chain is continuous (each merge request targets the source of the one below) and none comes from a fork;
- it has at most 20 merge requests;
- from 19.2 onward, they all have the same author.
On GitHub, what GitHub itself reports about stacked pull requests applies.
Before retargeting a merge request (in the sync, the fold or the stack merge), Versora reads its target on the server again. If the server already retargeted it, Versora leaves it alone, and the two don't compete.
| Option | What it does |
|---|---|
| Automatic (default) | The "Stack: !10 → !11" block goes into the merge request descriptions only when the server doesn't show the stack (GitLab before 19.1, GitHub without stacked pull requests). Once the server shows it, syncing removes the block without touching the author's text. |
| Always | The block goes into the description even when the server already shows the stack. |
| Never | Versora doesn't write anything in merge request descriptions. |
In automatic mode, when the server already shows the stack, updating the navigation removes the block and says: "GitLab already shows this stack: the navigation was removed from 3 merge request descriptions." (or "the navigation stays out of the description", when there was no block).
In Never mode, asking for the update shows "Navigation in the description is turned off (Preferences › Stacks)." with the Preferences button.
Creating a merge request and editing descriptions happen on the server: Ctrl+Z doesn't undo them. To remove the navigation from a description, choose Never and delete the block by hand, or edit the merge request in the browser. A push done by the form doesn't go into Ctrl+Z either.
- "No GitLab or GitHub set up for this remote: the stack works locally only (create, restack and push).": register the server with a token in Git servers.
- "Couldn't remove the navigation from some merge requests: …": the account can't edit the description of one of them.
- Implicit merge requests (one targeting another one's branch) already form a stack for Versora, even without a local record. See Branch stacks.
- Preferences › Stacks › Navigation in the description: Automatic, Always or Never.
- The token must be able to edit the merge requests (
apiscope on GitLab,repoon GitHub).