Skip to content

Commit dace80e

Browse files
committed
make the default logic be to use auto-close that can be optionally disabled
1 parent 948a4ac commit dace80e

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ By using the `--minimum` flag you can require a minimum number of pull requests
126126
gh combine owner/repo --minimum 3
127127
```
128128

129+
### Do Not Auto-Close Linked PRs
130+
131+
By default, the source pull requests that are combined into the new pull request will be automatically closed when the combined Pr merges by adding the `closes` keyword to the new pull request. This can be disabled by using the `--no-autoclose` flag.
132+
133+
```bash
134+
gh combine owner/repo --no-autoclose
135+
```
136+
129137
### Only Combine Pull Requests that match a given Label(s)
130138

131139
```bash

internal/cmd/root.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var (
2727

2828
requireCI bool
2929
mustBeApproved bool
30-
autoclose bool
30+
noAutoclose bool
3131
updateBranch bool
3232
reposFile string
3333
minimum int
@@ -116,7 +116,7 @@ func NewRootCmd() *cobra.Command {
116116
117117
# Additional options
118118
gh combine owner/repo --dry-run # Simulate the actions without making any changes
119-
gh combine owner/repo --autoclose # Close source PRs when combined PR is merged
119+
gh combine owner/repo --no-autoclose # Do not auto-close source PRs when combined PR is merged via the closes keyword
120120
gh combine owner/repo --base-branch main # Use a different base branch for the combined PR
121121
gh combine owner/repo --no-color # Disable color output
122122
gh combine owner/repo --no-stats # Disable stats summary display
@@ -145,7 +145,7 @@ func NewRootCmd() *cobra.Command {
145145
rootCmd.Flags().BoolVar(&requireCI, "require-ci", false, "Only include PRs with passing CI checks")
146146
rootCmd.Flags().BoolVar(&dependabot, "dependabot", false, "Only include PRs with the dependabot branch prefix")
147147
rootCmd.Flags().BoolVar(&mustBeApproved, "require-approved", false, "Only include PRs that have been approved")
148-
rootCmd.Flags().BoolVar(&autoclose, "autoclose", false, "Close source PRs when combined PR is merged")
148+
rootCmd.Flags().BoolVar(&noAutoclose, "no-autoclose", false, "Do not auto-close source PRs when combined PR is merged")
149149
rootCmd.Flags().BoolVar(&updateBranch, "update-branch", false, "Update the branch of the combined PR if possible")
150150
rootCmd.Flags().StringVar(&baseBranch, "base-branch", "main", "Base branch for the combined PR (default: main)")
151151
rootCmd.Flags().StringVar(&combineBranchName, "combine-branch-name", "combined-prs", "Name of the combined PR branch")
@@ -454,8 +454,8 @@ func buildCommandString(args []string) string {
454454
if mustBeApproved {
455455
cmd = append(cmd, "--require-approved")
456456
}
457-
if autoclose {
458-
cmd = append(cmd, "--autoclose")
457+
if noAutoclose {
458+
cmd = append(cmd, "--no-autoclose")
459459
}
460460
if updateBranch {
461461
cmd = append(cmd, "--update-branch")

0 commit comments

Comments
 (0)