diff --git a/completers/git_completer/cmd/commit_graph_generated.go b/completers/git_completer/cmd/commitGraph.go similarity index 57% rename from completers/git_completer/cmd/commit_graph_generated.go rename to completers/git_completer/cmd/commitGraph.go index 8d8553fce4..ca958feeb5 100644 --- a/completers/git_completer/cmd/commit_graph_generated.go +++ b/completers/git_completer/cmd/commitGraph.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" ) -var commit_graphCmd = &cobra.Command{ +var commitGraphCmd = &cobra.Command{ Use: "commit-graph", Short: "Write and verify Git commit-graph files", Run: func(cmd *cobra.Command, args []string) {}, @@ -13,7 +13,7 @@ var commit_graphCmd = &cobra.Command{ } func init() { - carapace.Gen(commit_graphCmd).Standalone() - commit_graphCmd.Flags().String("object-dir", "", "The object directory to store the graph") - rootCmd.AddCommand(commit_graphCmd) + carapace.Gen(commitGraphCmd).Standalone() + + rootCmd.AddCommand(commitGraphCmd) } diff --git a/completers/git_completer/cmd/commitGraph_verify.go b/completers/git_completer/cmd/commitGraph_verify.go new file mode 100644 index 0000000000..c3c256f8fe --- /dev/null +++ b/completers/git_completer/cmd/commitGraph_verify.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var commitGraph_verifyCmd = &cobra.Command{ + Use: "verify", + Short: "Read the commit-graph file and verify its contents against the object database", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(commitGraph_verifyCmd).Standalone() + + commitGraph_verifyCmd.Flags().Bool("no-progress", false, "Turn progress off explicitly") + commitGraph_verifyCmd.Flags().String("object-dir", "", "Use given directory for the location of packfiles and commit-graph file") + commitGraph_verifyCmd.Flags().Bool("progress", false, "Turn progress on explicitly") + commitGraph_verifyCmd.Flags().Bool("shallow", false, "Only check the tip commit-graph file in a chain of split commit-graphs") + commitGraphCmd.AddCommand(commitGraph_verifyCmd) + + carapace.Gen(commitGraph_verifyCmd).FlagCompletion(carapace.ActionMap{ + "object-dir": carapace.ActionDirectories(), + }) +} diff --git a/completers/git_completer/cmd/commitGraph_write.go b/completers/git_completer/cmd/commitGraph_write.go new file mode 100644 index 0000000000..78291d6b54 --- /dev/null +++ b/completers/git_completer/cmd/commitGraph_write.go @@ -0,0 +1,36 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var commitGraph_writeCmd = &cobra.Command{ + Use: "write", + Short: "Write a commit-graph file based on the commits found in packfiles", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(commitGraph_writeCmd).Standalone() + + commitGraph_writeCmd.Flags().Bool("append", false, "Include all commits that are present in the existing commit-graph file") + commitGraph_writeCmd.Flags().Bool("changed-paths", false, "Compute and write information about the paths changed between a commit and its first parent") + commitGraph_writeCmd.Flags().String("max-new-filters", "", "Generate at most n new Bloom filters") + commitGraph_writeCmd.Flags().Bool("no-max-new-filters", false, "Do not limit Bloom filters") // TODO verify + commitGraph_writeCmd.Flags().Bool("no-progress", false, "Turn progress off explicitly") + commitGraph_writeCmd.Flags().String("object-dir", "", "Use given directory for the location of packfiles and commit-graph file") + commitGraph_writeCmd.Flags().Bool("progress", false, "Turn progress on explicitly") + commitGraph_writeCmd.Flags().Bool("reachable", false, "Generate the new commit graph by walking commits starting at all refs.") + commitGraph_writeCmd.Flags().String("split", "", "Write the commit-graph as a chain of multiple commit-graph files stored in /info/commit-graphs") + commitGraph_writeCmd.Flags().Bool("stdin-commits", false, "Generate the new commit graph by walking commits starting at the commits specified in stdin as a list of OIDs in hex, one OID per line") + commitGraph_writeCmd.Flags().Bool("stdin-packs", false, "Generate the new commit graph by walking objects only in the specified pack-indexe") + commitGraphCmd.AddCommand(commitGraph_writeCmd) + + commitGraph_writeCmd.MarkFlagsMutuallyExclusive("reachable", "stdin-packs", "stdin-commits") + + carapace.Gen(commitGraph_writeCmd).FlagCompletion(carapace.ActionMap{ + "object-dir": carapace.ActionDirectories(), + "split": carapace.ActionValues("no-merge", "replace"), + }) +}