(rev1: str, rev2: str)
| 46 | |
| 47 | |
| 48 | def git_commit_log(rev1: str, rev2: str) -> list[CommitInfo]: |
| 49 | result = subprocess.run( |
| 50 | ["git", "log", "--pretty=%H\t%an\t%s", f"{rev1}..{rev2}"], |
| 51 | text=True, |
| 52 | capture_output=True, |
| 53 | check=True, |
| 54 | ) |
| 55 | commits = [] |
| 56 | for line in result.stdout.splitlines(): |
| 57 | commit, author, title = line.strip().split("\t", 2) |
| 58 | pr_number = None |
| 59 | if m := re.match(r".*\(#([0-9]+)\) *$", title): |
| 60 | pr_number = int(m.group(1)) |
| 61 | title = re.sub(r" *\(#[0-9]+\) *$", "", title) |
| 62 | |
| 63 | author = normalize_author(author) |
| 64 | entry = CommitInfo(commit, author, title, pr_number) |
| 65 | commits.append(entry) |
| 66 | return commits |
| 67 | |
| 68 | |
| 69 | def filter_omitted_commits(commits: list[CommitInfo]) -> list[CommitInfo]: |
no test coverage detected
searching dependent graphs…