Skip to content

emrg: merge stop-git.ps1 into stop-emrg.cmd as single file (rant 2026-08-12T14:00:05) - #702

Merged
argszero merged 1 commit into
masterfrom
feature/stop-git-merge-single-file
Aug 12, 2026
Merged

emrg: merge stop-git.ps1 into stop-emrg.cmd as single file (rant 2026-08-12T14:00:05)#702
argszero merged 1 commit into
masterfrom
feature/stop-git-merge-single-file

Conversation

@argszero

Copy link
Copy Markdown
Owner

Merge stop-git.ps1 into stop-emrg.cmd as a single file (rant 2026-08-12T14:00:05)

Background

Host decision 2026-08-12 (B plan: merge first, release v0.2.28 later). PR #701
delivered CRLF enforcement + truthful stop-git failure but kept the separate
bin/stop-git.ps1 (make-installer still references it, stop-emrg.cmd step 4
still calls it). The host explicitly asked for a single file.

Changes

  1. bin/stop-git.ps1 deleted — the guilt-by-association kill logic now lives
    inline in bin/stop-emrg.cmd step 4 as a single powershell -Command
    invocation:
    • prefix-scoped: $env:USERPROFILE\.emrg\install\git\* only (system Git in
      Program Files never matched)
    • pass 1: force-kill the git tree (git/ssh/plink/bash)
    • pass 2: guilt-by-association — force-kill every survivor under the prefix
      (sh/vim included, host 2026-08-11T19:47:44 decision)
    • each pass re-queries Get-CimInstance (no stale snapshot); the survivor
      check uses the latest snapshot; residual → exit 1 (truthful failure, emrg: enforce CRLF for Windows .cmd/.ps1 + truthful stop-git failure (rant 2026-08-12T12:30:41) #701)
    • quoting: uses the same \" escaping already proven on real Windows in the
      TUI-fallback and :verify inline snippets (shipped since v0.2.25-v0.2.27),
      avoiding both the 0.2.26 quoting-escape bug and temp-file generation
  2. packaging/make-installer.sh: removed the [Files] dontcopy entry for
    stop-git.ps1 and the GitStopScript/ExtractTemporaryFile('stop-git.ps1')
    plumbing in PrepareToInstall — now only extracts and runs stop-emrg.cmd
  3. packaging/build-runtime.sh: removed the stop-git.ps1 copy line
  4. tests/test_installer_stop.py: rewritten to pin the single-file wiring
    (inline -Command + \" escapes, no -File/GITSTOP remnants, 3 fresh
    Get-CimInstance enumerations, truthful exit 1); added a guard that
    bin/stop-git.ps1 does not exist and packaging has no functional references

Acceptance (from rant)

  • bin/ has no stop-git.ps1; grep stop-git matches history comments only ✅
  • make-installer.sh / build-runtime.sh have no stop-git functional references ✅
  • stop-emrg.cmd single file: step 1-3 (GUI/TUI/daemon) + step 4 (inline git kill)
    • verify, full flow ✅ (text-wired by tests; real Windows run by host)

Verification

  • pytest: 730 passed (count unchanged — one test replaced, one added)
  • Import + CLI sanity OK
  • tests/test_cmd_crlf.py green (CRLF preserved: 105/105)
  • No version bump — release v0.2.28 to follow after host confirms (per rant)

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

Reviewed the full diff on feature/stop-git-merge-single-file:

  1. Single-file merge is faithful: bin/stop-git.ps1 deleted and its logic inlined into bin/stop-emrg.cmd step 4 as one powershell -NoProfile -ExecutionPolicy Bypass -Command invocation. Semantics identical to the proven standalone script:
    • prefix-scoped to $env:USERPROFILE\.emrg\install\git\* only (system Git never matched)
    • pass 1 kills the git tree (git/ssh/plink/bash), pass 2 guilt-by-association kills every survivor under the prefix
    • each pass re-queries Get-CimInstance (3 fresh enumerations, no stale snapshot); the survivor check uses the latest query
    • exit 1 names survivors (truthful failure per #701), exit 0 only when nothing survives
  2. Escaping: the \" pattern matches the :verify inline snippet already proven on real Windows since v0.2.25–v0.2.27 — avoids the 0.2.26 quoting-escape bug; single-quoted PS literals and @(...) array-wrap are correct.
  3. Packaging: [Files] dontcopy entry + ExtractTemporaryFile('stop-git.ps1') + GitStopScript/%~1 plumbing all removed from make-installer.sh; build-runtime.sh copy line removed. No functional stop-git references remain (grep matches history comments only).
  4. Tests: rewritten to pin the single-file wiring (no -File/GITSTOP remnants, 3 enumerations, truthful exit 1) + guards that bin/stop-git.ps1 does not exist and packaging has no functional references. tests/test_installer_stop.py + tests/test_cmd_crlf.py: 6/6 passed.
  5. Full suite: uv run pytest tests/730 passed in 22.9s (matches PR claim; CRLF 105/105 preserved).
  6. No CI/workflow changes; no version bump (correct — v0.2.28 release to follow per the rant).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

Reviewed the full diff of #702 (single-file merge of stop-git.ps1 into stop-emrg.cmd):

  1. Faithful merge: stop-git.ps1 deleted; its guilt-by-association logic inlined as one powershell -ExecutionPolicy Bypass -Command in step 4 — prefix-scoped to %USERPROFILE%\.emrg\install\git\* (system Git never matched), pass 1 kills git tree (git/ssh/plink/bash), pass 2 kills every survivor (sh/vim included per host 2026-08-11T19:47:44).
  2. Fresh enumeration: each pass + the survivor check re-query Get-CimInstance (3 times) — no stale snapshot; residual → Write-Host names + exit 1 (truthful failure per #701).
  3. Escaping: \" matches the proven TUI/verify inline snippets shipped since v0.2.25 — avoids the 0.2.26 quoting bug and temp-file generation.
  4. Packaging: no dontcopy/GitStopScript remnants in make-installer.sh or build-runtime.sh; tests pin the wiring (incl. bin/stop-git.ps1 absent + CRLF 105/105).
  5. CI: test run 31568952199 PASS. Local pytest 730 green (net-zero test delta). No version bump — release v0.2.28 deferred until host confirms per rant.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

3rd consecutive ✅ (R1057 + parallel + this cycle, no ❌ in between). Head 9721194 unchanged since my earlier audit — full diff re-verified: single-file merge faithful to the deleted stop-git.ps1 (prefix-scoped guilt-by-association, 3 fresh Get-CimInstance queries, truthful exit 1), \" escaping matches the proven :verify pattern, packaging references removed, CRLF 105/105, full suite 730 passed. Merge condition satisfied.

@argszero
argszero merged commit a64c274 into master Aug 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant