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

Improve PR info in default merge message #9635

Merged
merged 3 commits into from
Jan 8, 2020

Conversation

shashvat-kedia
Copy link
Contributor

@shashvat-kedia shashvat-kedia commented Jan 7, 2020

Fix for issue #9552.

@6543
Copy link
Member

6543 commented Jan 7, 2020

@SD1998 think you took the wrong issue number

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 7, 2020
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@c88f0fe). Click here to learn what that means.
The diff coverage is 20%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9635   +/-   ##
=========================================
  Coverage          ?   42.22%           
=========================================
  Files             ?      582           
  Lines             ?    77109           
  Branches          ?        0           
=========================================
  Hits              ?    32559           
  Misses            ?    40552           
  Partials          ?     3998
Impacted Files Coverage Δ
models/pull.go 46.25% <20%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c88f0fe...0cd12d1. Read the comment docs.

models/pull.go Outdated
log.Error("Cannot load issue %d for PR id %d: Error: %v", pr.IssueID, pr.ID, err)
return ""
}
return fmt.Sprintf("Merge pull request %d: '%s' from '%s' of %s/%s into %s", pr.IssueID, pr.Issue.Title, pr.HeadBranch, pr.MustHeadUserName(), pr.HeadRepo.Name, pr.BaseBranch)
Copy link
Member

@6543 6543 Jan 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return fmt.Sprintf("Merge pull request %d: '%s' from '%s' of %s/%s into %s", pr.IssueID, pr.Issue.Title, pr.HeadBranch, pr.MustHeadUserName(), pr.HeadRepo.Name, pr.BaseBranch)
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)

this is more like github + has still the PR title in it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need index not ID

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more 👀 see more - added to suggestion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@6543 I have made the change.

@lunny lunny added the type/enhancement An improvement of existing functionality label Jan 8, 2020
@lunny lunny modified the milestones: 1.11.0, 1.12.0 Jan 8, 2020
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 8, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 8, 2020
Copy link
Contributor

@bagasme bagasme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, but can it be merged for v1.12?

@lunny
Copy link
Member

lunny commented Jan 8, 2020

@bagasme yes, it will.

@6543

This comment has been minimized.

@zeripath zeripath changed the title Fix #9552: Merge commits generated by pull request capture pull reque… Improve PR info in default merge message Jan 8, 2020
@zeripath
Copy link
Contributor

zeripath commented Jan 8, 2020

Make lg-tm work

@zeripath zeripath merged commit 632fb5b into go-gitea:master Jan 8, 2020
@danwilliams
Copy link

@SD1998 @zeripath this PR does not fully satisfy ticket #9552, as it only changes the merge title, and does not put the PR description into the merge commit message body. Hence part of the issue remains outstanding.

However, my question is how to modify this without altering the source code and recompiling? I preferred the old format, before this change. Many people will prefer the new format. It seems to be possible to put templates into each repository, to override - but is there a way to apply a system-wide default? If so, this would allow the both my question and the remaining parts of the issue to be addressed.

Apologies if this is covered somewhere in documentation, but I could not find anything.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants