PR #772 follow-ups: session_start.py report accuracy nf-d17w ← Beads

closed priority 2 task unassigned

Twinned from https://github.com/cfsh/ninefold/issues/779 by tools/beads/import_github.py's reconcile pass.

Suggestions from ninefold-reviewer's review of #772 (second pass, b3bd978). Unclaimed, unlabelled — fold them into #772's branch instead if you prefer; nothing here blocks that PR. Sibling of the closed #775.

  1. AHEAD and OFF-MAIN label untracked files as "uncommitted tracked edits"tools/pr/session_start.py, orient(). dirty comes from git status --porcelain --untracked-files=all and holds both kinds; tracked_clean comes from git diff --quiet HEAD and sees only tracked ones. Both report paths choose the *label* off tracked_clean and then print the *whole* tuple:

- AHEAD: ("Uncommitted tracked edits as well: " if not tracked_clean else "Untracked files as well: ") + _named(dirty) - OFF-MAIN: if dirty and not tracked_clean: → "there are uncommitted tracked edits here … {_named(dirty)}"

One tracked edit plus three scratch files makes AHEAD print all four under "Uncommitted tracked edits" — in the one verdict that ends "report it — do not resolve it silently", so it sends a human looking for edits that are not there. #601's rule, which _main_held_elsewhere already quotes against itself: naming the wrong fact costs more than omitting it. Partitioning dirty into tracked/untracked once, up front, would fix both sites and simplify the elif on the OFF-MAIN path.

  1. "The seven states" heads an eight-row tabletools/pr/session_start.py docstring. #775-6 moved the count from five to seven while UNKNOWN made the table eight. Listed as done on #775, so worth closing properly.
  1. report() says untracked files "did not block the fast-forward" on CURRENTuntracked_only=bool(dirty) is set on the CURRENT return as well as the FAST-FORWARDED one, and no merge was attempted on that path.

Two things deliberately not raised on the PR and recorded here only: the unused field import in session_start.py (no lint lane runs over tools/, so nothing will ever catch it), and the hook's timeout: 30 bounding a network git fetch — a slow fetch kills the process and yields no report at all, rather than the OFFLINE verdict the tool has for exactly that case. The second has no clean fix inside the current design; it would want a bounded fetch rather than a bounded hook.

Dependencies

None.

Comments

No comments.

Add a comment