Skip to content

Commit 08a58e5

Browse files
authored
Merge pull request #3264 from carapace-sh/git-skipto
git: moved `skip-to` and `rotate-to`
2 parents a94c532 + efbe680 commit 08a58e5

File tree

6 files changed

+4
-14
lines changed

6 files changed

+4
-14
lines changed

completers/common/git_completer/cmd/common/diff.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ func AddDiffFlags(cmd *cobra.Command) {
8585
cmd.Flags().Bool("raw", false, "Generate the diff in raw format")
8686
cmd.Flags().String("relative", "", "exclude changes outside the directory")
8787
cmd.Flags().Bool("rename-empty", false, "Whether to use empty blobs as rename source")
88+
cmd.Flags().String("rotate-to", "", "Move the files before the named <file> to the end")
8889
cmd.Flags().Bool("shortstat", false, "Output only the last line of the --stat format")
90+
cmd.Flags().String("skip-to", "", "Discard the files before the named <file> from the output")
8991
cmd.Flags().String("src-prefix", "", "Show the given source prefix instead of \"a/\"")
9092
cmd.Flags().String("stat", "", "Generate a diffstat")
9193
cmd.Flags().String("stat-count", "", "Generate diffstat with limited lines")
@@ -126,6 +128,8 @@ func AddDiffFlags(cmd *cobra.Command) {
126128
"follow": carapace.ActionFiles(), // TODO complete files of specific revision/modified between commits?
127129
"ignore-submodules": carapace.ActionValues("none", "untracked", "dirty", "all"),
128130
"output": carapace.ActionFiles(),
131+
"rotate-to": carapace.ActionFiles(), // TODO complete files of specific revision/modified between commits?
132+
"skip-to": carapace.ActionFiles(), // TODO complete files of specific revision/modified between commits?
129133
"submodule": carapace.ActionValues("short", "long", "log"),
130134
"word-diff": git.ActionWordDiffModes(),
131135
"ws-error-highlight": git.ActionWsErrorHighlightModes().UniqueList(","),

completers/common/git_completer/cmd/diff.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,10 @@ func init() {
2323
// TODO move into common flag groups
2424
diffCmd.Flags().StringS("G", "G", "", "Look for differences whose patch text contains added/removed lines that match <regex>")
2525
diffCmd.Flags().Bool("quiet", false, "Disable all output of the program")
26-
diffCmd.Flags().String("rotate-to", "", "Move the files before the named <file> to the end")
27-
diffCmd.Flags().String("skip-to", "", "Discard the files before the named <file> from the output")
2826
diffCmd.Flags().Bool("staged", false, "Show diff between index and named commit")
2927
common.AddDiffFlags(diffCmd)
3028
rootCmd.AddCommand(diffCmd)
3129

32-
carapace.Gen(diffCmd).FlagCompletion(carapace.ActionMap{
33-
"skip-to": carapace.ActionFiles(), // TODO complete files of specific revision/modified between commits?
34-
})
35-
3630
carapace.Gen(diffCmd).PositionalAnyCompletion(
3731
actionDiffArgs(diffCmd),
3832
)

completers/common/git_completer/cmd/diffFiles.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ func init() {
2525
diffFilesCmd.Flags().Bool("mailmap", false, "Use mailmap file to map author and committer name")
2626
diffFilesCmd.Flags().Bool("no-relative", false, "Do not show relative pathnames")
2727
diffFilesCmd.Flags().BoolS("q", "q", false, "Remain silent even for nonexistent files")
28-
diffFilesCmd.Flags().String("rotate-to", "", "Move the files before the named <file> to the end")
29-
diffFilesCmd.Flags().String("skip-to", "", "Discard the files before the named <file> from the output")
3028
diffFilesCmd.Flags().Bool("use-mailmap", false, "Use mailmap file to map author and committer name")
3129
common.AddDiffFlags(diffFilesCmd)
3230
common.AddPrettyFlags(diffFilesCmd)

completers/common/git_completer/cmd/diffIndex.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ func init() {
2222
diffIndexCmd.Flags().Bool("merge-base", false, "use the merge base between <tree-ish> and HEAD")
2323
diffIndexCmd.Flags().Bool("no-relative", false, "do not make the output relative")
2424
diffIndexCmd.Flags().Bool("quiet", false, "disable all output of the program")
25-
diffIndexCmd.Flags().String("rotate-to", "", "move files before the named <file> to the end")
26-
diffIndexCmd.Flags().String("skip-to", "", "discard the files before the named <file> from the output ")
2725
common.AddDiffFlags(diffIndexCmd)
2826
rootCmd.AddCommand(diffIndexCmd)
2927

completers/common/git_completer/cmd/diffTree.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ func init() {
2929
diffTreeCmd.Flags().Bool("quiet", false, "disable all output of the program")
3030
diffTreeCmd.Flags().BoolS("r", "r", false, "recurse into sub-trees")
3131
diffTreeCmd.Flags().Bool("root", false, "show the initial commit as a big creation event")
32-
diffTreeCmd.Flags().String("rotate-to", "", "move the files before the named <file> to end")
3332
diffTreeCmd.Flags().Bool("show-notes-by-default", false, "show the default notes unless options for displaying specific notes are given")
34-
diffTreeCmd.Flags().String("skip-to", "", "discard the files before the named <file> from the output")
3533
diffTreeCmd.Flags().Bool("stdin", false, "read from standard input")
3634
diffTreeCmd.Flags().BoolS("t", "t", false, "show tree entry itself as well as subtrees")
3735
diffTreeCmd.Flags().BoolS("v", "v", false, "also show the commit message before the differences")

completers/common/git_completer/cmd/log.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ func init() {
4545
logCmd.Flags().Bool("no-use-mailmap", false, "Do not use mailmap file to map author and committer names and email addresses to canonical real names and email addresses.")
4646
logCmd.Flags().String("notes", "", "Show the notes that annotate the commit")
4747
logCmd.Flags().Bool("reverse", false, "Output the commits chosen to be shown (see Commit Limiting section above) in reverse order. Cannot be combined with --walk-reflogs.")
48-
logCmd.Flags().String("rotate-to", "", "Discard the files before the named <file> from the output (i.e. skip to), or move them to the end of the output (i.e. rotate to).")
4948
logCmd.Flags().Bool("show-pulls", false, "Include all commits from the default mode, but also any merge commits that are not TREESAME to the first parent but are TREESAME to a later parent.")
5049
logCmd.Flags().Bool("simplify-by-decoration", false, "Commits that are referred by some branch or tag are selected.")
5150
logCmd.Flags().Bool("simplify-merges", false, "First, build a history graph in the same way that --full-history with parent rewriting does.")
52-
logCmd.Flags().String("skip-to", "", "Discard the files before the named <file> from the output (i.e. skip to), or move them to the end of the output (i.e. rotate to).")
5351
logCmd.Flags().Bool("source", false, "Print out the ref name given on the command line by which each commit was reached.")
5452
logCmd.Flags().Bool("sparse", false, "All commits that are walked are included.")
5553
logCmd.Flags().BoolS("t", "t", false, "Show the tree objects in the diff output.")

0 commit comments

Comments
 (0)