<commit_before>__author__ = 'tommi'

from subprocess import Popen, PIPE
from datetime import datetime

def gitlog(nagiosdir):
    """
    Executed git log and returns a array of recent changes in order newest to oldest
    """
    fh = Popen(["git", "log" ,"-5", "--pretty=%an:%ae:%at:%s"], cwd=nagiosdir, stdin=None, stdout=PIPE )

    gitstring = fh.communicate()[0]

    result = []
    for logline in gitstring.splitlines():
        author, authoremail, authortime, comment = logline.split(":")
        result.append( {
            "author": author,
            "authoremail": authoremail,
            "authortime": datetime.fromtimestamp(float(authortime)),
            "comment": comment,
        })
    return result<commit_msg>Fixed bug where git comment included colon.<commit_after>__author__ = 'tommi'

from subprocess import Popen, PIPE
from datetime import datetime

def gitlog(nagiosdir):
    """
    Executed git log and returns a array of recent changes in order newest to oldest
    """
    fh = Popen(["git", "log" ,"-5", "--pretty=%an:%ae:%at:%s"], cwd=nagiosdir, stdin=None, stdout=PIPE )

    gitstring = fh.communicate()[0]

    result = []
    for logline in gitstring.splitlines():
        author, authoremail, authortime, comment = logline.split(":", 3)
        result.append( {
            "author": author,
            "authoremail": authoremail,
            "authortime": datetime.fromtimestamp(float(authortime)),
            "comment": comment,
        })
    return result
{'fraction_non_alphanumeric': 0.1317365269461078, 'fraction_numerical': 0.00332667997338656, 'mean_word_length': 2.9683377308707124, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5803430', 'n_tokens_mistral': 463, 'n_tokens_neox': 452, 'n_words': 124}