Skip to content

fix(submit): omit stack metadata for single-patch stacks - #1696

Open
ChrisJr404 wants to merge 1 commit into
arxanas:masterfrom
ChrisJr404:submit-single-patch-stack-metadata
Open

ChrisJr404 wants to merge 1 commit into
arxanas:masterfrom
ChrisJr404:submit-single-patch-stack-metadata

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #1681.

git branchless submit --forge github prefixes the PR title with [1/1] and adds a **Stack:** list to the body even when the stack is a single commit, so the list just points back at the PR you're already looking at. For projects that squash-merge using the PR title plus body, that noise ends up in the commit history.

This skips the [N/N] title prefix and the stack list when the stack has a single patch, along the lines of what @claytonrcarter suggested on the issue. Multi-patch stacks are unchanged.

One follow-on: for a single-patch stack the create step already sets the final title and body, so the update step had nothing left to change and used to print Updating pull request (none (this should not happen)). I made the metadata update conditional on there actually being a change, so that line is gone and we skip a redundant update call.

Updated the existing single-patch snapshots in test_github_forge.rs to cover the new output.

When submitting a GitHub pull request for a stack of a single commit, the
title got a redundant [1/1] prefix and the body listed a stack pointing
only at the PR itself. Skip both for single-patch stacks. Since create
already sets the final title and body in that case, the follow-up update
now has nothing to change, so skip the no-op metadata update too.

Closes arxanas#1681
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exclude stack details from single-patch stacks

1 participant