summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-04-04 15:43:57 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-04-04 15:47:32 +0100
commita880701ddeadf5a2280a9d5ab710e29c86db09bc (patch)
tree25b0e8bdfec4f4bbd2ac93ac60a6604d19f4b275
parentfd908026c2d12ac83c51fe9ed57c3316230ea105 (diff)
downloadgitano-a880701ddeadf5a2280a9d5ab710e29c86db09bc.tar.bz2
UPDATE-HOOK: Extra audit message information
Increase the audit log message data to include the update action type, and the old and new SHA. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--bin/gitano-update-hook.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/gitano-update-hook.in b/bin/gitano-update-hook.in
index 34acbf9..bb7d8fe 100644
--- a/bin/gitano-update-hook.in
+++ b/bin/gitano-update-hook.in
@@ -93,18 +93,24 @@ local context = {
-- Attempt to work out what's going on regarding the update.
+local action = "**UNKNOWN**"
+
if oldsha == nullsha and newsha ~= nullsha then
context["operation"] = "createref"
+ action = "creation"
elseif oldsha ~= nullsha and newsha == nullsha then
context["operation"] = "deleteref"
+ action = "deletion"
else
local base, msg = repo.git:merge_base(oldsha, newsha)
if not base then
gitano.log.fatal(msg)
elseif (base == true) or ((base) and (base == newsha)) then
context["operation"] = "updaterefnonff"
+ action = "non-ff update"
else
context["operation"] = "updaterefff"
+ action = "update"
end
end
@@ -283,7 +289,8 @@ end
gitano.log.info("Allowing ref update of",
refname, "from", oldsha, "to", newsha)
-gitano.log.syslog.info("Allowing ref update of", refname)
+gitano.log.syslog.info("Allowing ref", action, "of", refname,
+ "( was", oldsha, "is now", newsha, ")")
gitano.log.syslog.close()