Add configurable git section to root config mirroring repver's git automation#3
Draft
Add configurable git section to root config mirroring repver's git automation#3
Conversation
Introduce GitConfig struct mirroring the repver application's git configuration. RootConfig now uses a nested Git field instead of top-level BranchPrefix and CreatePR. A rawRootConfig handles backward compatibility by migrating deprecated fields. Defaults, validation, and PR constants (PullRequestNo, PullRequestGitHubCLI) are included. Updated apply.go, bootstrap.go, and config_test.go to use the new rootCfg.Git.* paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add nested git section to root config with configurable branch prefix, commit messages, push behavior, remote, pull request creation method, PR titles/bodies, return to original branch, and branch deletion. Maintain backward compatibility with legacy branch_prefix and create_pr top-level fields. Add validation rules matching repver constraints. Update apply and bootstrap commands to use new config fields. Parameterize gitops.Push with configurable remote, add DeleteBranch. Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
Update root-config.md, gitops.md, and commands.md to document the new git section, all configurable fields, validation rules, and backward compatibility with legacy top-level fields. Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add configuration for automating pull requests
Add configurable git section to root config mirroring repver's git automation
Mar 11, 2026
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.
Mirrors the git automation configuration from repver into the root config, enabling control over commit messages, push behavior, remote, PR creation method, branch cleanup, and checkout restore.
Config changes (
internal/config/root.go)GitConfigstruct nested undergit:key with fields:branch_prefix,commit_message,bootstrap_commit_message,push,remote,pull_request(NO/GITHUB_CLI),pr_title,pr_body,bootstrap_pr_title,bootstrap_pr_body,return_to_original_branch,delete_branchbranch_prefixandcreate_prfields are migrated intogitsection at load time;gitsection takes precedencepull_request: GITHUB_CLIrequirespush: true;delete_branchrequiresreturn_to_original_branch: trueCommand changes (
internal/cmd/apply.go,bootstrap.go)GitOps changes (
internal/gitops/gitops.go)Push()now accepts aremoteparameter instead of hardcoding"origin"DeleteBranch()for local branch cleanupExample config
Tests
11 new test cases covering full git section parsing, all defaults, backward compatibility migration, precedence, and validation rejection of invalid combinations.
Docs
Updated
root-config.md,gitops.md, andcommands.mdto reflect the new git section and all configurable behaviors.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.