def METHOD_NAME(
    old_commit_id: str,
    new_commit_id: str,
) -> List[Commit]:
    commit_ids_in_chronological_order: List[str] = []
    # This callback will be called for all commits in the git history, from
    # newer ones to older ones.  Therefore, prepending will yield commits in
    # chronological order.
    def on_commit(commit_id: str) -> None:
        commit_ids_in_chronological_order.insert(0, commit_id)
    git.traverse_commits(
        new_commit=new_commit_id,
        old_commit=old_commit_id,
        on_commit=on_commit,
    )
    # Now all we need to do is to filter out all our recorded commits that are
    # within this window.
    return [
        commit
        for commit in commits_in_chronological_order
        if any(
            [
                commit_id == commit.number
                for commit_id in commit_ids_in_chronological_order
            ]
        )
    ]