Skip to content

Add gitFlowFinishArgs config option for git flow finish#5375

Open
Xyerophyte wants to merge 1 commit intojesseduffield:masterfrom
Xyerophyte:feature/git-flow-finish-args
Open

Add gitFlowFinishArgs config option for git flow finish#5375
Xyerophyte wants to merge 1 commit intojesseduffield:masterfrom
Xyerophyte:feature/git-flow-finish-args

Conversation

@Xyerophyte
Copy link

Summary

  • Adds a new gitFlowFinishArgs config option under git: that accepts a list of extra arguments to append to git flow <type> finish <name>
  • When the list is empty (default), git flow finish behaves exactly as before
  • Useful for teams that need flags like --keepremote or --keeplocal to control post-finish behavior

Closes #5296

Example config

git:
  gitFlowFinishArgs:
    - --keepremote

Changes

  • pkg/config/user_config.go: Added GitFlowFinishArgs []string field to GitConfig with empty default
  • pkg/commands/git_commands/flow.go: Appends configured args to the git flow finish command via the Arg() builder
  • pkg/commands/git_commands/flow_test.go: Added test cases for single and multiple extra args
  • schema-master/config.json: Added schema entry for the new field
  • docs-master/Config.md: Added documentation for the new config option

Test plan

  • Existing tests for git flow finish still pass (no args = same behavior)
  • New test: single extra arg (--keepremote) is appended
  • New test: multiple extra args (--keepremote --keeplocal) are appended
  • CI validates auto-generated schema and docs match

Made with Cursor

Allow users to pass extra arguments to git flow finish via a new gitFlowFinishArgs config option. This is useful for teams that need flags like --keepremote to prevent remote branch deletion after finishing a git flow branch.

Closes jesseduffield#5296

Made-with: Cursor
Copilot AI review requested due to automatic review settings March 14, 2026 23:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new user-configurable git.gitFlowFinishArgs option to append extra arguments to git flow <type> finish <name>, enabling teams to customize git-flow finish behavior (e.g. keeping remote branches) without changing default behavior.

Changes:

  • Introduces GitFlowFinishArgs []string in GitConfig with an empty default.
  • Appends configured args when building the git flow ... finish command.
  • Extends tests, schema, and docs to cover and document the new option.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
schema-master/config.json Adds JSON schema entry for gitFlowFinishArgs under git.
pkg/config/user_config.go Adds GitFlowFinishArgs to GitConfig and sets default to an empty slice.
pkg/commands/git_commands/flow.go Appends GitFlowFinishArgs to the git flow <type> finish command argv.
pkg/commands/git_commands/flow_test.go Adds test scenarios for single/multiple extra args and threads userConfig into deps.
docs-master/Config.md Documents the new gitFlowFinishArgs option and its default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow arguments config for git flow finish commands

2 participants