Repository navigation
fix: add git editor fallback in devcontainer setup - #393
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes an interactive git commit failure mode inside the devcontainer when a host-provided core.editor points to a binary that doesn’t exist in-container, by enforcing a safe editor fallback during container git setup.
Changes:
- Add
setup-git-conf.shlogic to detect unusable configured/effective git editor and setcore.editor=nanoonly when needed. - Add an integration regression test covering invalid
core.editorfallback behavior. - Record the fix in the upstream and workspace-template changelogs (Unreleased/Fixed).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| assets/workspace/.devcontainer/scripts/setup-git-conf.sh | Adds a guarded editor validation + fallback to nano during devcontainer git setup. |
| tests/test_integration.py | Adds an integration regression test that reproduces an invalid editor config and asserts fallback behavior. |
| CHANGELOG.md | Documents the fix under Unreleased → Fixed. |
| assets/workspace/.devcontainer/CHANGELOG.md | Mirrors the changelog entry in the workspace template copy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Fixes the devcontainer bug where
git commitwithout-mcan fail if a host-providedcore.editoris unavailable inside the container. The setup script now applies a safe fallback editor only when needed, and regression coverage validates the behavior.Type of Change
fix-- Bug fixfeat-- New featuredocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
assets/workspace/.devcontainer/scripts/setup-git-conf.shgit config --global core.editor nanoonly when the editor is missing/invalid in-containertests/test_integration.pytest_setup_git_conf_falls_back_to_nano_for_invalid_editor.devcontainer/.conf/.gitconfig, rerun setup script, assert fallback tonanoCHANGELOG.md#383assets/workspace/.devcontainer/CHANGELOG.mdChangelog Entry
Fixed
setup-git-conf.shnow validates the effective Git editor and setscore.editor=nanoonly when the configured editor is missing or invalid in-containerTesting
just test)Manual Testing Details
N/A
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
test(setup): add regression for invalid git editor fallbackfix(setup): add git core.editor fallback for container shellsdocs(image): record git editor fallback fix in changelogjust builduv run pytest tests/test_integration.py -k test_setup_git_conf_falls_back_to_nano_for_invalid_editor -v --tb=shortRefs: #383