diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2014-04-04 15:43:57 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2014-04-04 15:47:32 +0100 |
commit | a880701ddeadf5a2280a9d5ab710e29c86db09bc (patch) | |
tree | 25b0e8bdfec4f4bbd2ac93ac60a6604d19f4b275 /bin | |
parent | fd908026c2d12ac83c51fe9ed57c3316230ea105 (diff) | |
download | gitano-a880701ddeadf5a2280a9d5ab710e29c86db09bc.tar.gz |
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>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/gitano-update-hook.in | 9 |
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() |