Skip to content

Commit

Permalink
git: fmt-merge-msg
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Oct 29, 2023
1 parent 1f05a76 commit bcd904d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
30 changes: 30 additions & 0 deletions completers/git_completer/cmd/fmtMergeMsg.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/tools/git"
"github.com/spf13/cobra"
)

var fmtMergeMsgCmd = &cobra.Command{
Use: "fmt-merge-msg",
Short: "Produce a merge commit message",
Run: func(cmd *cobra.Command, args []string) {},
GroupID: groups[group_low_level_helper].ID,
}

func init() {
carapace.Gen(fmtMergeMsgCmd).Standalone()

fmtMergeMsgCmd.Flags().StringP("file", "F", "", "Take the list of merged objects from <file> instead of stdin")
fmtMergeMsgCmd.Flags().String("into-name", "", "Prepare the merge message as if merging to the branch <branch>")
fmtMergeMsgCmd.Flags().String("log", "", "At most <n> commits from each merge parent will be used (20 if <n> is omitted)")
fmtMergeMsgCmd.Flags().StringP("message", "m", "", "Use <message> instead of the branch names for the first line of the log message")
fmtMergeMsgCmd.Flags().Bool("no-log", false, "Do not list one-line descriptions from the actual commits being merged")
rootCmd.AddCommand(fmtMergeMsgCmd)

carapace.Gen(fmtMergeMsgCmd).FlagCompletion(carapace.ActionMap{
"file": carapace.ActionFiles(),
"into-name": git.ActionRefs(git.RefOption{LocalBranches: true, RemoteBranches: true, Tags: true}),
})
}
21 changes: 0 additions & 21 deletions completers/git_completer/cmd/fmt_merge_msg_generated.go

This file was deleted.

0 comments on commit bcd904d

Please sign in to comment.