From 983c7151ae9179dfde43edf95e2f76534385756f Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 4 Nov 2019 13:40:16 +0000 Subject: [PATCH] show branch name in !version output --- modules/info.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/info.py b/modules/info.py index 73c367a2..6674e39f 100644 --- a/modules/info.py +++ b/modules/info.py @@ -11,6 +11,7 @@ class Module(ModuleManager.BaseModule): ref = None with open(head_filepath, "r") as head_file: ref = head_file.readline().split(" ", 1)[1].strip() + branch = ref.rsplit("/", 1)[1] ref_filepath = os.path.join(git_dir, ref) if os.path.isfile(ref_filepath): @@ -19,7 +20,7 @@ class Module(ModuleManager.BaseModule): out = "Version: BitBot %s" % IRCBot.VERSION if not commit_hash == None: - out = "%s (%s)" % (out, commit_hash[:8]) + out = "%s (%s@%s)" % (out, branch, commit_hash[:8]) event["stdout"].write(out) @utils.hook("received.command.source")