Add configurable default remote - #160
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable default git remote name to Forge’s configuration system and updates CLI behavior so repo resolution uses the configured remote when --remote is not provided, falling back to origin.
Changes:
- Added
remotesupport in the[default]config section and ensured it merges correctly between user config and project.forge. - Updated CLI remote selection to follow precedence:
--remote> configured remote >origin. - Documented the new setting and added tests covering config merging and CLI precedence.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new [default] remote setting and precedence behavior. |
| internal/config/config.go | Adds DefaultSection.Remote and loads remote from config files. |
| internal/config/config_test.go | Extends config parsing/merge tests to cover the remote setting. |
| internal/cli/root.go | Implements runtime remote precedence and updates --remote help text. |
| internal/cli/root_test.go | Adds a test verifying CLI precedence between config, flag, and fallback. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
andrew
left a comment
There was a problem hiding this comment.
Please address these before merging:
- Add a test that runs through
rootCmd.Execute()with a realistic Git repository and covers the configured remote, the--remoteoverride, and theoriginfallback. The current test callsPersistentPreRundirectly and only inspects internal state. - Update the comment on
resolve.Repo; it still says the fallback readsorigin, though it can now read the configured remote.
|
Thanks, Addressed both items. The remote precedence test now runs through |
andrew
left a comment
There was a problem hiding this comment.
The requested CLI-boundary coverage is in place, the documentation is current, and the remote precedence works through the production command path.
Fixes #113
Summary
remotesetting in the[default]config section--remoteis not provided--remote> configured remote >origin.forgefilesTesting
go build ./...go test -race ./...go tool golangci-lint run ./...git diff --check