emrg: resolve git exe path once (install-info → bundled → PATH fallback) - #712
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Independent re-verification on head a51100c (3 files, 29+/22-, git exe path resolution):
- Root cause — daemon restarted from an environment without PATH git → bare
gitsubprocess raises FileNotFoundError →_is_usable_git_repo()misjudges "not a git repo" → evolution cycles silently skipped (2026-08-12 incident). Fix: resolve the git executable once per handler (resolve_git_gh()[0] or "git"in__init__) and use it across all 11 scheduler git call sites (_get_git_head,_is_usable_git_repo,_ensure_git_identity,_align_to_installed_version,_clone_workspace,_ensure_origin_reachable,_remote_advanced). _detect_git_remotenow routes throughgit_cmd(resolved git), which preservesno_prompt_env()+win32_no_window_kwargs()— no GCM popup / no cmd-window regression from #545/#592.- Tests adapted — FakeRunner and set-url assertions use
Path(cmd[0]).name in ("git", "git.exe")so they behave identically whether the exe is a literalgit(dev) or an absolute bundled path (packaged). - Regression — ran pytest: 744 passed (67 scheduler incl. the adapted FakeRunner tests), import + CLI OK. No bare-
gitsubprocess calls remain in scheduler.py (only theor "git"fallback default). No issues found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle. CI PASS (run 31589948464) + local verification: pytest 744 green on head a51100c. Reviewed full diff: resolve_git_gh()[0] || 'git' resolved once in TaskScheduler.init and threaded through all git subprocess calls (_get_git_head / _is_usable_git_repo / _ensure_git_identity / _align_to_installed_version / _clone_workspace / _ensure_origin_reachable / _remote_advanced) + git_utils._detect_git_remote via git_cmd — closes the 2026-08-12 incident where a bare 'git' FileNotFoundError (OSError) made _is_usable_git_repo return False → false 'not a git repo' → all evolution cycles skipped. Test mocks updated to match by basename (git/git.exe) so dev vs bundled environments behave identically. No issues found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
3rd consecutive ✅ (re-verified head a51100c unchanged from my R1146 review; git-exe resolution audited — all 11 scheduler call sites use resolved exe, git_cmd preserves no-window/no-prompt env). CI Test run 31589948464 SUCCESS. Merge condition met.
Summary