fix: Windows install and PowerShell compatibility fixes#1237
Merged
Conversation
- Config set/unset commands now print success messages to stdout instead of stderr, preventing PowerShell from interpreting them as errors. - Fix double-backslash bug in Windows git path candidates (raw string r"C:\\..." is literal double-backslash, not an escape). Add cmd\git.exe variants, %LOCALAPPDATA% per-user install paths, and where.exe fallback. - Fix path_is_git_ai_binary to detect copied shims on Windows (the installer copies git-ai.exe to git.exe, not symlink/hardlink, so the same_file check fails — sibling existence is sufficient on Windows). - Move config.json write before install-hooks in both install.ps1 and install.sh so git_path is available when resolve_git_path runs on first install. - Add copy_dir_recursive fallback in ensure_git_symlinks when mklink /J junction creation fails (MDM-managed environments may block cmd.exe). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Junctions via mklink /J don't require admin privileges, so the copy_dir_recursive fallback is unnecessary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The install script config.json ordering change is not needed — the improved git path resolution in resolve_git_path is sufficient to find git on first install. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collapse the try_resolve_git_path/resolve_git_path split back into a single function (the split was scaffolding for the removed try_fresh). Fix collapsible_if lint that only fires on Windows targets, and switch path_is_git_ai_binary from cfg!() macros to #[cfg] attributes for codebase consistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On Windows, path_is_git_ai_binary uses sibling existence check only (no same_file call), so the function is dead code on that target. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
cmd\git.exevariants,%LOCALAPPDATA%per-user install paths, andwhere.exefallbackpath_is_git_ai_binarynow detects copied shims on Windows (installer copiesgit-ai.exetogit.exe, which thesame_filecheck missed)config.jsonwrite beforeinstall-hookscall in bothinstall.ps1andinstall.shsogit_pathis available on first installcopy_dir_recursivefallback inensure_git_symlinkswhenmklink /Jfails (MDM-managed environments)Test plan
task buildcompiles cleanlytask lintandtask fmtpasstask test— all 3001 integration tests pass, 0 failuresgit-ai config set quiet trueprints to stdout (no red PowerShell error)install-hookswithout "Could not locate a real 'git' binary" errorAPI_BASEis set🤖 Generated with Claude Code