Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow imperative form of 'fix'. #9

Merged
merged 2 commits into from

3 participants

@airblade

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

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 Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@airblade airblade Allow imperative form of 'close'.
This is consistent with git's message style.
01e4d4c
@igrigorik igrigorik merged commit 2b3f6fe into from
@igrigorik
Owner

Awesome, thanks!

@msgerbush

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.

@igrigorik
Owner

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

@msgerbush

Cool, I'll put in a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 19, 2011
  1. @airblade
  2. @airblade

    Allow imperative form of 'close'.

    airblade authored
    This is consistent with git's message style.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/bugspots/scanner.rb
View
2  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
end
repo.commits(branch, depth).each do |commit|
Something went wrong with that request. Please try again.