From cb847faaecde373bdfa626a0d3858f3688d591cf Mon Sep 17 00:00:00 2001 From: Dastan-glitch Date: Wed, 1 Mar 2023 17:00:46 +0300 Subject: [PATCH] bin/ircd: [commitbot] display commit message up to the first newline --- bin/ircd/script/bots/commitbot.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/ircd/script/bots/commitbot.py b/bin/ircd/script/bots/commitbot.py index d18f65e9b..60380c401 100644 --- a/bin/ircd/script/bots/commitbot.py +++ b/bin/ircd/script/bots/commitbot.py @@ -95,14 +95,12 @@ def handle_forward_push(irc, data): print("==============================================") irc.send("#dev", f"@{author} pushed {num_commits} to {branch}: {commit}") -MAX_COMMIT_LEN = 256 - def fmt_commit(cmt): hsh = cmt['id'][:10] # author = cmt['author']['name'] - message = cmt['message'] - message = message[:MAX_COMMIT_LEN] \ - + ('..' if len(message) > MAX_COMMIT_LEN else '') + message = cmt['message'].split("\n") + message = message[0] \ + + ('...' if len(message) > 1 else '') return '{}: {}'.format(hsh, message)