Skip to content

Commit 446cb7b

Browse files
authored
Merge pull request #3262 from carapace-sh/git-diff-flags
git: add missing diff flags
2 parents ba510f0 + 3fabbf4 commit 446cb7b

File tree

6 files changed

+2
-8
lines changed

6 files changed

+2
-8
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func AddDiffFlags(cmd *cobra.Command) {
2525
cmd.Flags().String("color-words", "", "Equivalent to --word-diff=color plus (if a regex was specified)")
2626
cmd.Flags().Bool("compact-summary", false, "Output a condensed summary of extended header information")
2727
cmd.Flags().Bool("cumulative", false, "Synonym for --dirstat=cumulative")
28+
cmd.Flags().Bool("default-prefix", false, "Use the default source and destination prefixes")
2829
cmd.Flags().String("diff-algorithm", "", "")
2930
cmd.Flags().String("diff-filter", "", "filter files")
3031
cmd.Flags().StringP("dirstat", "X", "", "Output the distribution of relative amount of changes for each sub-directory")
@@ -42,6 +43,7 @@ func AddDiffFlags(cmd *cobra.Command) {
4243
cmd.Flags().BoolP("ignore-all-space", "w", false, "Ignore whitespace when comparing lines")
4344
cmd.Flags().Bool("ignore-blank-lines", false, "Ignore changes whose lines are all blank")
4445
cmd.Flags().Bool("ignore-cr-at-eol", false, "Ignore carriage-return at the end of line when doing a comparison")
46+
cmd.Flags().StringP("ignore-matching-lines", "I", "", "Ignore changes whose all lines match <regex>")
4547
cmd.Flags().Bool("ignore-space-at-eol", false, "Ignore changes in whitespace at EOL")
4648
cmd.Flags().BoolP("ignore-space-change", "b", false, "Ignore changes in amount of whitespace")
4749
cmd.Flags().String("ignore-submodules", "", "Ignore changes to submodules in the diff generation")

completers/common/git_completer/cmd/diff.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ 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().String("follow", "", "Continue listing the history of a file beyond renames")
26-
diffCmd.Flags().StringArrayP("ignore-matching-lines", "I", nil, "Ignore changes whose all lines match <regex>")
2726
diffCmd.Flags().Bool("quiet", false, "Disable all output of the program")
2827
diffCmd.Flags().String("rotate-to", "", "Move the files before the named <file> to the end")
2928
diffCmd.Flags().String("skip-to", "", "Discard the files before the named <file> from the output")

completers/common/git_completer/cmd/diffFiles.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ func init() {
1919

2020
diffFilesCmd.Flags().StringS("G", "G", "", "Look for differences whose patch text contains added/removed lines that match <regex>")
2121
diffFilesCmd.Flags().Bool("default", false, "Use argument as default revision")
22-
diffFilesCmd.Flags().Bool("default-prefix", false, "Use the default source and destination prefixes")
2322
diffFilesCmd.Flags().Bool("early-output", false, "undocumented")
2423
diffFilesCmd.Flags().Bool("follow", false, "Continue listing the history of a file beyond renames")
2524
diffFilesCmd.Flags().Bool("full-diff", false, "Show full commit diffs")
26-
diffFilesCmd.Flags().StringP("ignore-matching-lines", "I", "", "Ignore changes whose all lines match <regex>")
2725
diffFilesCmd.Flags().Bool("log-size", false, "Print log message size in bytes before the message")
2826
diffFilesCmd.Flags().Bool("mailmap", false, "Use mailmap file to map author and committer name")
2927
diffFilesCmd.Flags().Bool("no-relative", false, "Do not show relative pathnames")

completers/common/git_completer/cmd/diffIndex.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ func init() {
1818
carapace.Gen(diffIndexCmd).Standalone()
1919

2020
diffIndexCmd.Flags().StringS("G", "G", "", "look for differences whose patch text contains added/removed lines that match <regex>")
21-
diffIndexCmd.Flags().Bool("default-prefix", false, "use the default source and destination prefixes")
22-
diffIndexCmd.Flags().StringP("ignore-matching-lines", "I", "", "ignore changes whose all lines match <regex>")
2321
diffIndexCmd.Flags().BoolS("m", "m", false, "make git diff-index say that all non-checked-out files are up to date")
2422
diffIndexCmd.Flags().Bool("merge-base", false, "use the merge base between <tree-ish> and HEAD")
2523
diffIndexCmd.Flags().Bool("no-relative", false, "do not make the output relative")

completers/common/git_completer/cmd/diffTree.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ func init() {
2020
diffTreeCmd.Flags().StringS("G", "G", "", "look for differences whose patch text contains added/removed lines that match <regex>")
2121
diffTreeCmd.Flags().Bool("always", false, "show the commit itself and the commit log message even if the diff itself is empty")
2222
diffTreeCmd.Flags().Bool("combined-all-paths", false, "let combined diffs list the name of the file from all parents")
23-
diffTreeCmd.Flags().Bool("default-prefix", false, "use the default source and destination prefixes")
24-
diffTreeCmd.Flags().StringP("ignore-matching-lines", "I", "", "ignore changes whose all lines match <regex>")
2523
diffTreeCmd.Flags().BoolS("m", "m", false, "show differences for merge commits")
2624
diffTreeCmd.Flags().Bool("merge-base", false, "use the merge base between the two <tree-ish>s as the \"before\" side")
2725
diffTreeCmd.Flags().Bool("no-commit-id", false, "suppress commit ID output")

completers/common/git_completer/cmd/log.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func init() {
3636
logCmd.Flags().Bool("full-diff", false, "With this, the full diff is shown for commits that touch the specified paths")
3737
logCmd.Flags().Bool("full-history", false, "Same as the default mode, but does not prune some history.")
3838
logCmd.Flags().BoolP("help", "h", false, "Show help.")
39-
logCmd.Flags().StringP("ignore-matching-lines", "I", "", "Ignore changes whose all lines match <regex>.")
4039
logCmd.Flags().Bool("log-size", false, "Include a line “log size <number>” in the output for each commit.")
4140
logCmd.Flags().Bool("mailmap", false, "Use mailmap file to map author and committer names and email addresses to canonical real names and email addresses.")
4241
logCmd.Flags().Bool("no-decorate", false, "Print out the ref names of any commits that are shown.")

0 commit comments

Comments
 (0)