Give each review pass at most two rounds per chunk, with no third round and no ask for one

This commit is contained in:
2026-10-28 17:37:09 +01:00
parent 47a40757c3
commit 0254e427f2
17 changed files with 116 additions and 79 deletions
+1 -5
View File
@@ -6,7 +6,7 @@ import sys
import typing
from rule_hook.rules import Breach
from rule_hook.git import existing, git
from rule_hook.git import existing, git, local_default_branch
from failure import Failure
from utc_stamp import utc
@@ -119,9 +119,5 @@ def unread_reflog(reflog: str | Failure, head: str | Failure) -> Failure | None:
return None if head in reflog.split() else Failure("it does not hold HEAD")
def local_default_branch(directory: str) -> str | None:
return next((name for name in ("origin/HEAD", "main", "master") if not isinstance(git(directory, "rev-parse", "--verify", "--quiet", name), Failure)), None)
def holds(directory: str, descendant: str, ancestor: str) -> bool:
return bool(ancestor) and not isinstance(git(directory, "merge-base", "--is-ancestor", ancestor, descendant), Failure)