From 7cb8573fa49f118278c9e5b27eba9d503f926421 Mon Sep 17 00:00:00 2001 From: rsteube Date: Sat, 17 Aug 2024 19:10:24 +0200 Subject: [PATCH] git: diff-tree --- completers/git_completer/cmd/diffTree.go | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 completers/git_completer/cmd/diffTree.go diff --git a/completers/git_completer/cmd/diffTree.go b/completers/git_completer/cmd/diffTree.go new file mode 100644 index 0000000000..0b2671af8b --- /dev/null +++ b/completers/git_completer/cmd/diffTree.go @@ -0,0 +1,61 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/git_completer/cmd/common" + "github.com/carapace-sh/carapace-bin/pkg/actions/tools/git" + "github.com/spf13/cobra" +) + +var diffTreeCmd = &cobra.Command{ + Use: "diff-tree", + Short: "diff-tree Compares the content and mode of blobs found via two tree objects", + Run: func(cmd *cobra.Command, args []string) {}, + GroupID: groups[group_low_level_interrogator].ID, +} + +func init() { + carapace.Gen(diffTreeCmd).Standalone() + + diffTreeCmd.Flags().StringS("G", "G", "", "look for differences whose patch text contains added/removed lines that match ") + diffTreeCmd.Flags().Bool("always", false, "show the commit itself and the commit log message even if the diff itself is empty") + diffTreeCmd.Flags().Bool("combined-all-paths", false, "let combined diffs list the name of the file from all parents") + diffTreeCmd.Flags().Bool("default-prefix", false, "use the default source and destination prefixes") + diffTreeCmd.Flags().StringP("ignore-matching-lines", "I", "", "ignore changes whose all lines match ") + diffTreeCmd.Flags().BoolS("m", "m", false, "show differences for merge commits") + diffTreeCmd.Flags().Bool("merge-base", false, "use the merge base between the two s as the \"before\" side") + diffTreeCmd.Flags().Bool("no-commit-id", false, "suppress commit ID output") + diffTreeCmd.Flags().Bool("no-notes", false, "do not show notes") + diffTreeCmd.Flags().Bool("no-relative", false, "do not show relative pathnames") + diffTreeCmd.Flags().Bool("no-textconv", false, "do not allow external text conversion filters") + diffTreeCmd.Flags().String("notes", "", "show the notes that annotate the commit") + diffTreeCmd.Flags().Bool("quiet", false, "disable all output of the program") + diffTreeCmd.Flags().BoolS("r", "r", false, "recurse into sub-trees") + diffTreeCmd.Flags().Bool("root", false, "show the initial commit as a big creation event") + diffTreeCmd.Flags().String("rotate-to", "", "move the files before the named to end") + diffTreeCmd.Flags().Bool("show-notes-by-default", false, "show the default notes unless options for displaying specific notes are given") + diffTreeCmd.Flags().String("skip-to", "", "discard the files before the named from the output") + diffTreeCmd.Flags().Bool("stdin", false, "read from standard input") + diffTreeCmd.Flags().BoolS("t", "t", false, "show tree entry itself as well as subtrees") + diffTreeCmd.Flags().BoolS("v", "v", false, "also show the commit message before the differences") + common.AddDiffFlags(diffTreeCmd) + common.AddCommitFormattingOptions(diffTreeCmd) + rootCmd.AddCommand(diffTreeCmd) + + diffTreeCmd.Flag("notes").NoOptDefVal = " " + diffTreeCmd.Flag("relative").NoOptDefVal = " " + + carapace.Gen(diffTreeCmd).FlagCompletion(carapace.ActionMap{ + "notes": git.ActionRefs(git.RefOption{}.Default()), + "relative": carapace.ActionDirectories(), + }) + + carapace.Gen(diffTreeCmd).PositionalCompletion( + git.ActionRefs(git.RefOption{}.Default()), + git.ActionRefs(git.RefOption{}.Default()), + ) + + carapace.Gen(diffTreeCmd).PositionalAnyCompletion( + carapace.ActionFiles(), + ) +}