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

The entire Merge template is used as the PR merge title #21435

Closed
Greg-NetDuma opened this issue Oct 13, 2022 · 2 comments · Fixed by #22248
Closed

The entire Merge template is used as the PR merge title #21435

Greg-NetDuma opened this issue Oct 13, 2022 · 2 comments · Fixed by #22248
Labels

Comments

@Greg-NetDuma
Copy link

Greg-NetDuma commented Oct 13, 2022

Description

I would like to use a merge template like so:

Merge pull request ${PullRequestReference} from ${HeadBranch} into ${BaseBranch}

${PullRequestTitle}

My expectation was that the first line is used as the title and the rest would be put in the PR message field, but it's not the case.

Instead the entire template is stripped of newline chars and jammed into the title field. See screenshot.

Gitea Version

1.17.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

Ubuntu 20.04

How are you running Gitea?

Official Docker image

Database

No response

@Greg-NetDuma Greg-NetDuma changed the title The entire Merge template is used as the PR merge title instead of the first line The entire Merge template is used as the PR merge title Oct 13, 2022
@Greg-NetDuma
Copy link
Author

Relevant PR #18177

@Artalus
Copy link

Artalus commented Dec 21, 2022

+1. I also tried to have multiline template like

(!${PullRequestIndex}) ${PullRequestTitle} 

Details: ${PullRequestDescription}

, so the first line would go to the title of merge-commit and the second to its description - but instead got (!123) T1337: awesome prDetails:

I would also like to mention, that even though https://docs.gitea.io/en-us/merge-message-templates/ and #18177 mention variable PullRequestDescription, it is not being expanded into a valid description at all at the moment.

lafriks pushed a commit that referenced this issue Dec 29, 2022
Fix #21435.

Use the first line of the template as the git commit message title, and
the rest as the description.

## Snapshots

<img width="806" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644083-5d85179c-cf58-404f-bc98-c662398a2411.png">
<img width="860" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644392-22573090-e2c1-458b-ba44-855b79735632.png">
<img width="1154" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644457-a1b2711a-6787-45b4-b52c-a88d7fc132d7.png">

Co-authored-by: delvh <dev.lh@web.de>
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants