fix(submit): omit stack metadata for single-patch stacks - #1696
Open
ChrisJr404 wants to merge 1 commit into
Open
ChrisJr404 wants to merge 1 commit into
ChrisJr404 wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1681.
git branchless submit --forge githubprefixes 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.rsto cover the new output.