Skip to content

emrg: resolve git exe path once (install-info → bundled → PATH fallback) - #712

Merged
argszero merged 1 commit into
argszero:masterfrom
pm25coder:feature/git-exe-resolution
Aug 12, 2026
Merged

emrg: resolve git exe path once (install-info → bundled → PATH fallback)#712
argszero merged 1 commit into
argszero:masterfrom
pm25coder:feature/git-exe-resolution

Conversation

@pm25coder

Copy link
Copy Markdown
Contributor

Summary

@argszero argszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

✅ LGTM — cycle

Independent re-verification on head a51100c (3 files, 29+/22-, git exe path resolution):

  1. Root cause — daemon restarted from an environment without PATH git → bare git subprocess 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).
  2. _detect_git_remote now routes through git_cmd (resolved git), which preserves no_prompt_env() + win32_no_window_kwargs() — no GCM popup / no cmd-window regression from #545/#592.
  3. 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 literal git (dev) or an absolute bundled path (packaged).
  4. Regression — ran pytest: 744 passed (67 scheduler incl. the adapted FakeRunner tests), import + CLI OK. No bare-git subprocess calls remain in scheduler.py (only the or "git" fallback default). No issues found.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

✅ 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 argszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

✅ 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.

@argszero
argszero merged commit 96b68de into argszero: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.

2 participants