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

Already on GitHub? Sign in to your account

Allow imperative form of 'fix'. #9

Merged
merged 2 commits into from Dec 20, 2011

Conversation

Projects
None yet
3 participants
Contributor

airblade commented Dec 19, 2011

This one-character change lets bugspots scan for commit messages like "Fix blah blah".

This style is consistent with git's own messages, as explained by the Pope:

Write your commit message in the present tense: "Fix bug" and not "Fixed
bug." This convention matches up with commit messages generated by
commands like git merge and git revert.

http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

@igrigorik igrigorik commented on an outdated diff Dec 19, 2011

lib/bugspots/scanner.rb
@@ -12,7 +12,7 @@ def self.scan(repo, branch = "master", depth = 500, words = nil)
if words
message_matchers = /#{words.split(',').join('|')}/
else
- message_matchers = /fix(es|ed)|close(s|d)/i
+ message_matchers = /fix(es|ed)?|close(s|d)/i
@igrigorik

igrigorik Dec 19, 2011

Owner

For sake of completeness, can you also do close(s|d)?

@airblade airblade Allow imperative form of 'close'.
This is consistent with git's message style.
01e4d4c

@igrigorik igrigorik added a commit that referenced this pull request Dec 20, 2011

@igrigorik igrigorik Merge pull request #9 from airblade/master
Allow imperative form of 'fix' / 'close'
2b3f6fe

@igrigorik igrigorik merged commit 2b3f6fe into igrigorik:master Dec 20, 2011

Owner

igrigorik commented Dec 20, 2011

Awesome, thanks!

Contributor

msgerbush commented Jan 5, 2012

Not sure that this default regexp makes sense, since most of the matches will not be related to actual tickets. For instance, any merges that include a 'hotfix' branch are now included in the fixing commits. I have an implementation that I am using on our codebase, and I have had more relevant results with /(fixes|closes) #(\d+)/i.

Also, related to #5, I think this type of matching would be easier if we allowed accepting arbitrary regexp's, instead of just a list of trigger words.

Owner

igrigorik commented Jan 7, 2012

That could work, we could either replace the -w option, or add an -r flag for regex.

Contributor

msgerbush commented Jan 7, 2012

Cool, I'll put in a pull request.

@msgerbush msgerbush added a commit to msgerbush/bugspots that referenced this pull request Jan 11, 2012

@msgerbush msgerbush Added -r option for arbitrary regex matching of commit messages refs #9. 423631f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment