Skip to content

Commit

Permalink
Fix lgtm checks and use pull request body for merge message
Browse files Browse the repository at this point in the history
Closes #33

LGTM given by: @nhance

Squashed commit of the following:

commit c169515
Author: Valentino <[email protected]>
Date:   Mon Mar 4 09:52:12 2013 -0500

    Bumbed version for gem updates

commit 7ff11b3
Author: Valentino <[email protected]>
Date:   Mon Mar 4 09:50:54 2013 -0500

    Use pull request body OR last commit message

commit 75687f5
Author: Valentino <[email protected]>
Date:   Wed Dec 26 10:06:00 2012 -0500

    [fix] lgtm checks are buggy

commit 124b1e5
Author: Valentino <[email protected]>
Date:   Thu Dec 6 15:43:19 2012 -0500

    Ensure comment author lookup is unique
  • Loading branch information
Valentino committed Mar 4, 2013
1 parent 4d1d1ed commit d6524ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/git_reflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def deliver(options = {})
# if there any comment_authors left, then they haven't given a lgtm after the last commit
if open_comment_authors.empty? or options['skip-lgtm']
lgtm_authors = comment_authors_for_pull_request(existing_pull_request, :with => LGTM)
commit_message = get_first_commit_message
commit_message = existing_pull_request[:body] || get_first_commit_message
puts "Merging pull request ##{existing_pull_request.number}: '#{existing_pull_request.title}', from '#{existing_pull_request.head.label}' into '#{existing_pull_request.base.label}'"

update_destination(options['base'])
Expand Down Expand Up @@ -210,9 +210,9 @@ def find_authors_of_open_pull_request_comments(pull_request)
comment_created_at = Time.parse(comment.created_at)
if comment_created_at > pull_last_committed_at
if comment[:body] =~ LGTM
lgtm_authors << comment.user.login
lgtm_authors |= [comment.user.login]
else
comment_authors << comment.user.login unless comment_authors.include?(comment.user.login)
comment_authors |= [comment.user.login] unless comment_authors.include?(comment.user.login)
end
else
comment_authors -= [comment.user.login] if comment_authors.include?(comment.user.login)
Expand All @@ -230,7 +230,7 @@ def comment_authors_for_pull_request(pull_request, options = {})

all_comments.each do |comment|
next if options[:after] and Time.parse(comment.created_at) < options[:after]
comment_authors << comment.user.login if !comment_authors.include?(comment.user.login) and (options[:with].nil? or comment[:body] =~ options[:with])
comment_authors |= [comment.user.login] if !comment_authors.include?(comment.user.login) and (options[:with].nil? or comment[:body] =~ options[:with])
end

# remove the current user from the list to check
Expand Down
2 changes: 1 addition & 1 deletion lib/git_reflow/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module GitReflow
VERSION = "0.2.4"
VERSION = "0.2.5"
end

0 comments on commit d6524ca

Please sign in to comment.