Skip to content

Commit

Permalink
Merge pull request #2514 from carapace-sh/git-replay
Browse files Browse the repository at this point in the history
git: replay
  • Loading branch information
rsteube authored Aug 17, 2024
2 parents 4ec7fd9 + 027020e commit 1b1ecb1
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions completers/git_completer/cmd/replay.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers_release/git_completer/cmd/common"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/git"
"github.com/spf13/cobra"
)

var replayCmd = &cobra.Command{
Use: "replay",
Short: "EXPERIMENTAL: Replay commits on a new base, works with bare repos too",
Run: func(cmd *cobra.Command, args []string) {},
GroupID: groups[group_low_level_manipulator].ID,
}

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

replayCmd.Flags().String("advance", "", "starting point at which to create the new commits")
replayCmd.Flags().String("onto", "", "starting point at which to create the new commits")
common.AddCommitFormattingOptions(replayCmd)
common.AddCommitLimitingOptions(replayCmd)
common.AddCommitOrderingOptions(replayCmd)
common.AddHistorySimplificationOptions(replayCmd)
common.AddObjectTraversalOptions(replayCmd)
rootCmd.AddCommand(replayCmd)

carapace.Gen(replayCmd).FlagCompletion(carapace.ActionMap{
"advance": git.ActionRefs(git.RefOption{}.Default()),
"onto": git.ActionLocalBranches(),
})

carapace.Gen(replayCmd).PositionalAnyCompletion(
git.ActionRefRanges(git.RefOption{}.Default()),
)
}

0 comments on commit 1b1ecb1

Please sign in to comment.