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

Fix ref parsing in commit messages #3067

Merged
merged 2 commits into from
Dec 3, 2017

Conversation

ethantkoenig
Copy link
Member

Fix bug where commit messages containing /# would cause an error, and the rest of the commit message would not be parsed for issue references. This is because GetIndexByRef would return ErrInvalidReference when it encountered /#.

This PR also

  • Improves the regexps for issue refs to avoid superfluous matches (issueReferenceKeywordsPat previously matched every word!)
  • Refactor common code so that it can be reused
  • Adds unit tests for commit message parsing

@lafriks lafriks added this to the 1.4.0 milestone Dec 2, 2017
@lafriks
Copy link
Member

lafriks commented Dec 2, 2017

Tests seems to be failing

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 2, 2017
@codecov-io
Copy link

codecov-io commented Dec 2, 2017

Codecov Report

Merging #3067 into master will increase coverage by 0.02%.
The diff coverage is 65.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3067      +/-   ##
==========================================
+ Coverage   33.45%   33.48%   +0.02%     
==========================================
  Files         270      270              
  Lines       39553    39534      -19     
==========================================
+ Hits        13232    13236       +4     
+ Misses      24429    24412      -17     
+ Partials     1892     1886       -6
Impacted Files Coverage Δ
models/issue.go 45.24% <ø> (+0.41%) ⬆️
models/action.go 65.04% <65.11%> (+1.24%) ⬆️
modules/indexer/repo.go 60.86% <0%> (-2.61%) ⬇️
models/repo_indexer.go 50.99% <0%> (-1%) ⬇️
models/repo.go 38.26% <0%> (+0.3%) ⬆️
modules/process/manager.go 81.15% <0%> (+4.34%) ⬆️

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 b0971ae...d03c242. Read the comment docs.

@lafriks
Copy link
Member

lafriks commented Dec 3, 2017

LGTM

@tboerger tboerger 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 Dec 3, 2017
@lunny
Copy link
Member

lunny commented Dec 3, 2017

LGTM

@tboerger tboerger 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 Dec 3, 2017
@lunny
Copy link
Member

lunny commented Dec 3, 2017

make L-G-T-M work

@lunny lunny merged commit 3163abe into go-gitea:master Dec 3, 2017
@ethantkoenig ethantkoenig deleted the fix/parse_commit_message branch December 3, 2017 03:07
@ethantkoenig ethantkoenig restored the fix/parse_commit_message branch December 3, 2017 18:07
@ethantkoenig ethantkoenig deleted the fix/parse_commit_message branch December 3, 2017 18:07
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 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/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants