Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2010-12-29 19:59:25 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2010-12-29 19:59:25 (GMT)
commit34ad582644f3e9f9bcb727f1acebd6ba00bf9e37 (patch)
tree2052f781bc3facb81c167d79fa5251982362608b
parent06491994824dec4d487e4987cccca52604cb15a5 (diff)
Send to CIA commit author instead of commiter
-rw-r--r--app/processors/push_event_processor.rb9
-rw-r--r--lib/cia.rb8
2 files changed, 11 insertions, 6 deletions
diff --git a/app/processors/push_event_processor.rb b/app/processors/push_event_processor.rb
index 2f84766..d0cb57d 100644
--- a/app/processors/push_event_processor.rb
+++ b/app/processors/push_event_processor.rb
@@ -260,7 +260,7 @@ class PushEventProcessor < ApplicationProcessor
end
def fetch_commit_details(an_event, commit_sha, event_timestamp = nil)
- sha, email, timestamp, message = git.show({
+ sha, email, timestamp, message, commit_author = git.show({
:pretty => git_pretty_format,
:s => true
}, commit_sha).split(PUSH_EVENT_GIT_OUTPUT_SEPARATOR_ESCAPED)
@@ -278,7 +278,7 @@ class PushEventProcessor < ApplicationProcessor
:timeout => false,
}, revspec)).split("\n")
commits.each do |c|
- sha, email, timestamp, message = c.split(PUSH_EVENT_GIT_OUTPUT_SEPARATOR_ESCAPED)
+ sha, email, timestamp, message, commit_author = c.split(PUSH_EVENT_GIT_OUTPUT_SEPARATOR_ESCAPED)
e = EventForLogging.new
if email
email = email.gsub(/\\(<|>)/, '\1')
@@ -302,7 +302,8 @@ class PushEventProcessor < ApplicationProcessor
},
:committed_at => e.commit_time.xmlschema,
:message => message,
- :timestamp => e.commit_time.xmlschema
+ :timestamp => e.commit_time.xmlschema,
+ :commit_author => commit_author
}
result << e
end
@@ -317,7 +318,7 @@ class PushEventProcessor < ApplicationProcessor
end
def git_pretty_format
- fmt = ['%H','%cn <%ce>','%at','%s'].join(PUSH_EVENT_GIT_OUTPUT_SEPARATOR)
+ fmt = ['%H','%cn <%ce>','%at','%s','%an'].join(PUSH_EVENT_GIT_OUTPUT_SEPARATOR)
"format:#{fmt}"
end
diff --git a/lib/cia.rb b/lib/cia.rb
index e1d6dac..df1dae3 100644
--- a/lib/cia.rb
+++ b/lib/cia.rb
@@ -41,7 +41,7 @@ module CIA
<timestamp>#{event.commit_time.to_i}</timestamp>
<body>
<commit>
- <author>#{event.commit_details[:author][:name]}</author>
+ <author>#{event.commit_details[:commit_author]}</author>
<revision>#{sha[0..11]}</revision>
<log>#{CGI.escapeHTML(event.commit_details[:message])}</log>
<url>http://#{GitoriousConfig['gitorious_host']}/#{repository.url_path}/commit/#{sha}</url>
@@ -53,7 +53,11 @@ module CIA
</message>
MSG
- server.call("hub.deliver", message)
+ begin
+ server.call("hub.deliver", message)
+ rescue Exception => e
+ logger.warn("Failed to notify CIA.vc: #{e}")
+ end
end
end
end