judge.base_commit(root)
The full SHA of HEAD, if the working tree is clean.
HEAD
Untracked files below regen/runs/ (earlier runs) do not make the tree dirty, and neither does a change outside the project’s folder when the project is a subfolder of the repository.
regen/runs/
ConfigurationError
root
import subprocess from pathlib import Path from tempfile import TemporaryDirectory from babregen.judge import base_commit with TemporaryDirectory() as tmp: root = Path(tmp) for args in (["init", "-q"], ["commit", "-q", "--allow-empty", "-m", "i"]): subprocess.run( ["git", "-c", "user.name=t", "-c", "user.email=t@example.org", *args], cwd=root, check=True, capture_output=True, ) print(len(base_commit(root)))
40