Skip to content

feat: pyauto-status dirty file listing + split MOD/UNTR columns #4

Description

@Jammy2211

Overview

Follow-up to #2 / PR #3. The pyauto-status dashboard currently shows a single DIRTY count per repo, with no detail about what is dirty. After surfacing real noise on first use (autolens_base_project 14 dirty, admin_jammy 4, etc.), it's clear we need (a) the actual file list per repo and (b) a way to track whether untracked junk is building up — i.e. when .gitignore needs to be extended.

This is a small enhancement, scoped only to PyAutoPrompt/scripts/pyauto_status.sh.

Plan

  • Cache git status --porcelain output once per repo (instead of running git status twice — once for the count, again would be needed for the listing)
  • Replace the single DIRTY column with two: MOD (tracked-modified files) and UNTR (untracked). The flag glyph * keeps firing if either is non-zero
  • After the main table, append a Dirty files: section listing the porcelain output for each repo with dirty content, indented under the repo name. Skip repos with nothing dirty
  • No auto-categorization of "looks generated" — the ?? vs M prefixes from porcelain output already tell the user what's untracked
  • Day-to-day signal: if UNTR climbs across runs for a repo, the .gitignore is missing patterns
Detailed implementation plan

Affected Repositories

  • PyAutoPrompt (only)

Work Classification

Library (treated as such for the standard /start_library → worktree → /ship_library flow).

Branch Survey

Repository Current Branch Dirty?
./PyAutoPrompt main clean

Suggested branch: feature/dashboard-dirty-listing
Worktree root: ~/Code/PyAutoLabs-wt/dashboard-dirty-listing/ (created later by /start_library)

Implementation Steps

  1. Edit PyAutoPrompt/scripts/pyauto_status.sh:

    • In the per-repo data-collection loop, capture porcelain="$(git -C "$repo" status --porcelain 2>/dev/null)" into a bash associative array keyed by repo name (declare -A repo_porcelain).
    • Compute mod and untr separately from the cached porcelain output: mod is lines NOT starting with ??, untr is lines starting with ??. Use grep -c against the cached string.
    • The flag column logic stays: * if (mod + untr) > 0.
  2. Update the printf format string and column headers:

    • Old: '%-32s %-30s %-36s %6s %5s %5s %s\n' with headers REPO BRANCH UPSTREAM BEHIND AHEAD DIRTY FLAGS.
    • New: '%-32s %-30s %-36s %6s %5s %4s %4s %s\n' with headers REPO BRANCH UPSTREAM BEHIND AHEAD MOD UNTR FLAGS.
    • Adjust the dashed separator row to match.
  3. After the main row loop, emit the dirty-file listing:

    • Iterate repos again. For each repo with non-empty ${repo_porcelain[$name]}, on the first hit print a blank line and Dirty files: header. Then print $name: followed by the porcelain content indented by 4 spaces (sed 's/^/ /').
    • No cap on file count — load-bearing signal, not noise. Can revisit if a repo overflows in practice.

Key Files

  • PyAutoPrompt/scripts/pyauto_status.sh — single-file change.

Acceptance Verification

  • time pyauto-status from a fresh shell still completes in <10s (no new git invocations).
  • A repo with 0 dirty shows MOD=0 UNTR=0, no * flag, and is omitted from the listing.
  • A repo with both modified-tracked and untracked files shows non-zero in both columns, and both appear in the listing with the correct M / ?? prefixes.
  • bash PyAutoPrompt/scripts/status.sh --repos still produces the new format (no regression on the delegation path).

Out of scope

  • Auto-categorizing untracked files as "likely generated" by extension — fragile, user-eye is faster.
  • Tracking dirty counts across runs (would need persistent state).
  • Color/highlight — kept plain text.

Original Prompt

This issue does not have a prompt-file source — it's a direct follow-up enhancement to PR #3 surfaced during day-1 use of pyauto-status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions