fix: detect if git is installed and exit with a clear error - #279
Open
sunasrd-byte wants to merge 1 commit into
Open
fix: detect if git is installed and exit with a clear error#279sunasrd-byte wants to merge 1 commit into
sunasrd-byte wants to merge 1 commit into
Conversation
sunasrd-byte
force-pushed
the
fix/133-git-preflight
branch
from
August 14, 2026 11:58
c904fe2 to
5db5c0c
Compare
NejcS
self-requested a review
August 17, 2026 08:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
GitPython import.
statement between imports, so every import below it trips E402.
message, no traceback, and exit 1 for --version, --status, and a render,
under both a git-less and a broken-git PATH.
Two failure modes are diagnosed separately:
normal state on macOS without the Command Line Tools, where /usr/bin/git is
a stub that exits with an xcrun error. GIT_PYTHON_REFRESH=quiet does not
suppress this: GitPython only consults that setting for a git it cannot
find. A PATH lookup alone is therefore insufficient, so require_git runs
'git version' — matching git_available in install/bash/install.sh.
Verified in python:3.12-slim without git, per the issue's reproduction steps.
Note: GitNotInstalledError is now unraised. Left in place rather than removed
as a drive-by API change.
Closes #133