* feat: add pygit2 compatibility wrapper for standalone Desktop 2.0 installs
Add git_compat.py abstraction layer that wraps both GitPython and pygit2
behind a unified GitRepo interface. When CM_USE_PYGIT2=1 is set (by the
Desktop 2.0 Launcher for standalone installs), or when system git is not
available, the pygit2 backend is used automatically.
Key changes:
- New comfyui_manager/common/git_compat.py with abstract GitRepo base class,
_GitPythonRepo (1:1 pass-throughs) and _Pygit2Repo implementations
- All 6 non-legacy files updated to use the wrapper:
- comfyui_manager/glob/manager_core.py (14 git.Repo usages)
- comfyui_manager/common/git_helper.py (7 git.Repo usages)
- comfyui_manager/common/context.py (1 usage)
- comfyui_manager/glob/utils/environment_utils.py (2 usages)
- cm_cli/__main__.py (1 usage)
- comfyui_manager/common/timestamp_utils.py (repo.heads usage)
- get_script_env() propagates CM_USE_PYGIT2 to subprocesses
- git_helper.py uses sys.path.insert to find git_compat as standalone script
- All repo handles wrapped in context managers to prevent resource leaks
- get_head_by_name returns _HeadProxy for interface consistency
- Submodule fallback logs clear message when system git is absent
- 47 tests comparing both backends via subprocess isolation
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d0ec5-cb9f-74df-a1a2-0c8154a330b3
* fix(pygit2): address review findings + bump version to 4.2b1
- C1: add submodule_update() after pygit2 clone for recursive parity
- C2: check subprocess returncode in submodule_update fallback
- C3: move GIT_OPT_SET_OWNER_VALIDATION to module-level (once at import)
- H1: use context manager in git_pull() to prevent resource leaks
- Bump version to 4.2b1, version_code to [4, 2]
- Add pygit2 to dev dependencies and requirements.txt
* style: fix ruff F841 unused variable and F541 unnecessary f-string
---------
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Dr.Lt.Data <dr.lt.data@gmail.com>
Three fixes for Windows E2E failures:
1. cm_cli reinstall_node(): URL-based node specs used the full URL
as lookup key, but internal dicts are keyed by repo basename or
cnr_id. Use get_cnr_by_repo() for CNR-aware lookup with correct
is_unknown flag.
2. git_helper.py gitclone(): disable tqdm progress when stderr is
piped (sys.stderr.isatty() gate) to prevent pipe buffer deadlock.
Also move stale directories from previous failed clones into
.disabled/.trash/ before cloning (GitPython handle leak on Windows).
3. try_rmtree(): 3-tier deletion strategy for Windows file locks:
retry 3x with delay, rename into .disabled/.trash/, then lazy-delete
via reserve_script as final fallback.
* fix(git_helper): surface git stderr and use portable exit code
- Redirect exception output to stderr for diagnostic visibility
- Surface GitCommandError.stderr when available
- Use sys.exit(1) instead of sys.exit(-1) for portable exit codes
- Remove debug print statements
* fix(e2e): cross-platform E2E tests with file-based stdout capture
- Cross-platform cm-cli path (Scripts/cm-cli.exe vs bin/cm-cli)
- File-based stdout/stderr capture to avoid Windows pipe buffer loss
- Rename uv-compile → uv-sync for standalone command refs
- Update conflict test packs: ansible → python-slugify/text-unidecode
- Add .trash_* cleanup and retry+rename for Windows file locks
- Add test_e2e_git_clone.py for nightly install via ComfyUI server
- Add setup_e2e_env.py cross-platform setup script
* feat(ci): add multiplatform E2E workflow (ubuntu/windows/macos)
Matrix: ubuntu-latest, windows-latest, macos-latest × Python 3.10
Triggers on push to main/feat/*/fix/* and PRs to main.
* bump version to 4.1b7
git_helper.py is spawned as a standalone subprocess on Windows
(manager_core.py:1342). The import of comfyui_manager.common.timestamp_utils
triggered comfyui_manager/__init__.py which imports from comfy.cli_args —
unavailable in the subprocess environment, causing ModuleNotFoundError.
Inline get_backup_branch_name() using only stdlib (time, uuid), preserving
the original collision-detection and UUID-fallback semantics. Add 9 tests
covering standalone subprocess loading, behavioral equivalence, edge cases
(repo.heads exception, 99-suffix exhaustion with UUID fallback).
- Use --ff-only flag to detect non-fast-forward situations
- Create backup branch before resetting divergent local branch
- Reset to remote branch when fast-forward is not possible
- Add timestamp_utils.py for Mac datetime module compatibility
- Migrate all datetime usages to centralized utilities
- Bump version to 4.0.3b5
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>