Skip to content

Change the git log format and splitting logic #31

Description

@damdo

The logic here is a bit fragile and breaks when the chosen separator is contained in the commit message.

rebasebot/rebasebot/bot.py

Lines 167 to 177 in 683a41f

commits = gitwd.git.log("--reverse", "--pretty=format:%H - %s - %aE", "--no-merges",
"--ancestry-path", f"{merge_base}..dest/{dest.branch}")
logging.info("Identified upstream commits:\n%s", commits)
commits_to_squash = defaultdict(list)
for commit in commits.splitlines():
# Commit contains the message for logging purposes,
# trim on the first space to get just the commit sha
sha, commit_message, committer_email = commit.split(" - ")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions