(repo: Path, *, limit: int = 80)
| 837 | |
| 838 | |
| 839 | def _git_commit_canvas_log(repo: Path, *, limit: int = 80) -> list[dict[str, Any]]: |
| 840 | result = _git_stdout( |
| 841 | repo, |
| 842 | [ |
| 843 | "log", |
| 844 | "--all", |
| 845 | "--topo-order", |
| 846 | "--date=iso-strict", |
| 847 | f"-n{limit}", |
| 848 | "--decorate=short", |
| 849 | "--pretty=format:%H%x1f%h%x1f%P%x1f%ad%x1f%an%x1f%s%x1f%b%x1f%D", |
| 850 | ], |
| 851 | ) |
| 852 | commits: list[dict[str, Any]] = [] |
| 853 | for line in result.splitlines(): |
| 854 | if not line.strip(): |
| 855 | continue |
| 856 | sha, short_sha, parents_raw, authored_at, author_name, subject, body, decorations = ( |
| 857 | line.split("\x1f") + ["", "", "", "", "", "", "", ""] |
| 858 | )[:8] |
| 859 | commits.append( |
| 860 | { |
| 861 | "sha": sha.strip(), |
| 862 | "short_sha": short_sha.strip(), |
| 863 | "parents": [item for item in parents_raw.strip().split() if item], |
| 864 | "authored_at": authored_at.strip(), |
| 865 | "author_name": author_name.strip(), |
| 866 | "subject": subject.strip(), |
| 867 | "body": body.strip(), |
| 868 | "decorations": decorations.strip(), |
| 869 | } |
| 870 | ) |
| 871 | return commits |
| 872 | |
| 873 | |
| 874 | def _normalize_branch_refs(raw: Any) -> list[str]: |
no test coverage detected