-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Automatically generated commit message when merging pull request is not clear #9898
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
Comments
The relevant section of code is in // GetDefaultMergeMessage returns default message used when merging pull request
func (pr *PullRequest) GetDefaultMergeMessage() string {
if pr.HeadRepo == nil {
var err error
pr.HeadRepo, err = GetRepositoryByID(pr.HeadRepoID)
if err != nil {
log.Error("GetRepositoryById[%d]: %v", pr.HeadRepoID, err)
return ""
}
}
if err := pr.LoadIssue(); err != nil {
log.Error("Cannot load issue %d for PR id %d: Error: %v", pr.IssueID, pr.ID, err)
return ""
}
return fmt.Sprintf("Merge pull request '%s' (#%d) from %s/%s into %s", pr.Issue.Title, pr.Issue.Index, pr.MustHeadUserName(), pr.HeadBranch, pr.BaseBranch)
} |
It should know the PR is from the same repository or a forked repository. |
Also it should really exclude merge commits and commits that merge commit includes |
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
[x]
):Description
When merging a pull request, Gitea automatically generates text for the commit message. It has the following format:
TITLE
: Merge pull request 'pull-request-name
' (#pull-request-number
) frombranch
intobranch
CONTENT
: Reviewed-on:url-of-pull-request
However, I've noticed a potential bug with the way it constructs the branch names. The first branch name is structured like:
organisation-name/branch-name
when I think it should be
organisation-name/repo-name/branch-name
OR justbranch-name
See the try.gitea example repo and the screenshots below for examples of this.
Screenshots
Organisation:
my1e5_test
Repo:
Merge-Pull-Request
Branch:
feature/my_branch
I use a folder structure for my branch name. I am merging into
master
.Notice how it says "from my1e5_test/feature/my_branch into master".
In my opinion this is not accurate. It should be just "from feature/my_branch into master" OR it should be "from my1e5_test/Merge-Pull-Request/feature/my_branch into master".
Missing out the repo name, but having the organisation name, is strange IMO.
The text was updated successfully, but these errors were encountered: