MCPcopy Create free account
hub / github.com/ResearAI/DeepScientist / _git_commit_canvas_log

Function _git_commit_canvas_log

src/deepscientist/gitops/diff.py:839–871  ·  view source on GitHub ↗
(repo: Path, *, limit: int = 80)

Source from the content-addressed store, hash-verified

837
838
839def _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
874def _normalize_branch_refs(raw: Any) -> list[str]:

Callers 1

list_commit_canvasFunction · 0.85

Calls 3

_git_stdoutFunction · 0.85
splitMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected