-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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()), | ||
) | ||
} |