Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Requests: show command line instructions closer to chosen merge style #22542

Closed
wants to merge 3 commits into from

Conversation

techknowlogick
Copy link
Member

Pull Requests: show command line instructions closer to chosen merge style

Only matches the default command though, does not manually update if you switch.
But for Blender we will likely have only one option anyway.

If the # is not already mentioned somewhere in the commit message, the
following is added at the end of the commit message:

Pull Request https://github.com/go-gitea/gitea/issues/123

To be upstreamable, this should at least be made optional behavior if it is
considered a good feature to have at all. It also only changes the last commit
in the stack which is not ideal.

Code by: @brechtvl

…style

Only matches the default command though, does not manually update if you switch.
But for Blender we will likely have only one option anyway.
If the # is not already mentioned somewhere in the commit message, the
following is added at the end of the commit message:

Pull Request go-gitea#123

To be upstreamable, this should at least be made optional behavior if it is
considered a good feature to have at all. It also only changes the last commit
in the stack which is not ideal.
@techknowlogick techknowlogick added the topic/ui Change the appearance of the Gitea UI label Jan 20, 2023
@techknowlogick techknowlogick added this to the 1.19.0 milestone Jan 20, 2023
@brechtvl
Copy link
Contributor

The title of this PR could be changed, as it's now from the lesser important commit in this branch. That part is about changing the instructions to avoid giving the wrong ones for our workflow. The implementation is not ideal as it does not automatically update when you change the choice on the page, the instructions only reflect the default choice which was enough for us as we have the other choices disabled.

The other part this branch is to be able to support our merge workflow, which is to use rebase without merge commits, but still have the PR # mentioned in the commit message. I put Pull Request #123 on a line at the bottom, because it matches our existing convention of commit messages looking like:

Fix #456: issue title

Some description.

Pull Request #123

Ideally there would be an option to configure things to work this way for us, though I imagine the Gitea default behavior would be to add (#123) at the end of the title.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 20, 2023
@brechtvl
Copy link
Contributor

I realized only now that there is a documented REBASE_TEMPLATE.md, but it is not used as far as I can tell.
https://docs.gitea.io/en-us/merge-message-templates/

For this to actually work I guess you would need to add variables like ${CommitTitle} and ${CommitBody}, and then you could write a template like:

${CommitTitle} (#${PullRequestIndex})

${CommitBody}

Or for us:

${CommitTitle}

${CommitBody}

Pull Request #${PullRequestIndex}

@brechtvl
Copy link
Contributor

brechtvl commented Jan 30, 2023

This PR can be closed, I think #22669 is a better solution using a merge message template.

@lunny lunny closed this Jan 31, 2023
@lunny lunny removed this from the 1.19.0 milestone Jan 31, 2023
@brechtvl brechtvl deleted the blender-pr-rebase-flow branch February 20, 2023 06:44
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants