From a880701ddeadf5a2280a9d5ab710e29c86db09bc Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 4 Apr 2014 15:43:57 +0100 Subject: 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 --- bin/gitano-update-hook.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bin') 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() -- cgit v1.2.1