const SEP = "<<SEP>>";
export const GIT_LOG_FORMAT = ["%H", "%P", "%s", "%an", "%aI"].join(SEP);
export function parseGitLog(raw) {
    if (!raw.trim())
        return [];
    return raw
        .trimEnd()
        .split("\n")
        .map((line) => {
        const parts = line.split(SEP);
        const parents = (parts[1] ?? "")
            .split(" ")
            .filter((sha) => sha.length > 0);
        return {
            sha: parts[0] ?? "",
            parents,
            message: parts[2] ?? "",
            author: parts[3] ?? "",
            date: parts[4] ?? "",
        };
    });
}
//# sourceMappingURL=git-log.js.map