Skip to content

Instantly share code, notes, and snippets.

@nicomen
Created February 22, 2013 13:55
Show Gist options
  • Save nicomen/5013543 to your computer and use it in GitHub Desktop.
Save nicomen/5013543 to your computer and use it in GitHub Desktop.
diff --git a/hubot/scripts/githook.coffee b/hubot/scripts/githook.coffee
index 34a706a..fd48020 100644
--- a/hubot/scripts/githook.coffee
+++ b/hubot/scripts/githook.coffee
@@ -181,7 +181,11 @@ module.exports = (robot) ->
message += "#{ if e.forced then "force-" else "" }pushed #{ M.NO("commit", e.commits.length) } "
message += "to #{ branch }"
message += " (#{ short or e.compare })"
- for commit in e.commits[-3..]
- message += "\n · #{ commit.message.split("\n")[0] } (#{ commit.id.substring(0,8) })"
+ if commits.length > 1
+ for commit in e.commits[-3..]
+ message += "\n · #{ commit.message.split("\n")[0] } (#{ commit.id.substring(0,8) })"
+ else
+ commit = commits[0]
+ message += " · #{ commit.message.split("\n")[0] } (#{ commit.id.substring(0,8) })"
sender message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment