github/github-services — Issue #171: IRC's commit formatting is incorrect
Author: eevee
Created: 2011-10-19 07:00:25+00:00
State: open

I get the following actual IRC activity:

21:41 < github> [blog] eevee pushed 1 new commit to master: https://github.com/eevee/blog/commit/49835fa7264af3ba0df1b8b513854e72b98c1eff
21:41 < github> [blog/master] New post about GitHub and IRC notificating. - Eevee

Whereas irc.rb:`format_commit_message` contains:

"#{repo_name}: #{branch_name} #{author} * " +
"#{sha1[0..6]} (#{files.size} files in #{dirs.size} dirs): #{short}"

The actual format being used is the default, which is particularly lame as it'll never contain IRC color escapes.

`commit_messages` is in `Service::PushHelpers`, which isn't in class scope so it ignores the `format_commit_messages` override in irc.rb. Probably.

Not really familiar enough with Ruby scoping rules to be sure of a fix, but I assume it'd work to change

messages += commit_messages.first(3)

to

messages += distinct_commits.first(3).map do |commit|
self.format_commit_message commit
end
# or?: messages += distinct_commits.first(3).map self.format_commit_message