Subject: [PATCH v3 00/24] completion: add missing diff options

From: "Philippe Blain via GitGitGadget" <[email-masked]>
Date: Mon, 26 Jun 2023 16:24:24 +0000

Changes since v2:

 * removed --patch-with-raw on Junio's suggestion, '-p --raw' does the exact
   same thing.

Changes since v1:

 * correted authorship in 21/25
 * fixed typos pointed out by Eric

v1: This series adds missing diff options to the Bash completion script.
Completion often serves as a discovery mechanism for options, so it is
beneficial to users if all options are offered by the completion script.

The list of missing options was generated by:

 1. Extracting all diff options from the documentation:
    
    git grep -h --no-column --only-match -e ^--[a-z][a-z-]*
    Documentation/diff-options.txt
    | sort -u > diff-options.txt

 2. Searching for each option in the completion script and visually checking
    which one was missing:
    
    while read p; do echo --- $p ---; echo; git grep --color -p -e $p
    upstream/master contrib/completion/git-completion.bash done <
    diff-options.txt

The only options I left out are --skip-to and --rotate-to, since I agree
with their documentation: they are probably not very useful outside of their
use in 'git difftool'.

Cheers,

Philippe.

Philippe Blain (24):
  completion: add comments describing __git_diff_* globals
  completion: complete --break-rewrites
  completion: complete --cc
  completion: complete --combined-all-paths
  completion: complete --compact-summary
  completion: complete --default-prefix
  completion: complete --find-copies
  completion: complete --find-object
  completion: complete --find-renames
  completion: complete --function-context
  completion: complete --ignore-matching-lines
  completion: complete --irreversible-delete
  completion: complete --ita-invisible-in-index and
    --ita-visible-in-index
  completion: complete --line-prefix
  completion: complete --no-relative
  completion: complete --no-stat
  completion: complete --output
  completion: complete --output-indicator-{context,new,old}
  completion: complete --unified
  completion: complete --ws-error-highlight
  completion: move --pickaxe-{all,regex} to __git_diff_common_options
  completion: complete --diff-merges, its options and --no-diff-merges
  completion: complete --remerge-diff
  diff.c: mention completion above add_diff_options

 contrib/completion/git-completion.bash | 57 ++++++++++++++++++++++----
 diff.c                                 |  4 ++
 2 files changed, 52 insertions(+), 9 deletions(-)

base-commit: fe86abd7511a9a6862d5706c6fa1d9b57a63ba09
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1543%2Fphil-blain%2Fcompletion-common-diff-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1543/phil-blain/completion-common-diff-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/1543

Range-diff vs v2:

  1:  4edabc7f15c =  1:  4edabc7f15c completion: add comments describing __git_diff_* globals
  2:  1f3c9e8d417 =  2:  1f3c9e8d417 completion: complete --break-rewrites
  3:  d38823dd116 =  3:  d38823dd116 completion: complete --cc
  4:  51024ee2f2c =  4:  51024ee2f2c completion: complete --combined-all-paths
  5:  63d70d645e2 =  5:  63d70d645e2 completion: complete --compact-summary
  6:  7296a3a8c9d =  6:  7296a3a8c9d completion: complete --default-prefix
  7:  1f9b213cee5 =  7:  1f9b213cee5 completion: complete --find-copies
  8:  53b1c348f82 =  8:  53b1c348f82 completion: complete --find-object
  9:  053f9e8620a =  9:  053f9e8620a completion: complete --find-renames
 10:  2503d990e5c = 10:  2503d990e5c completion: complete --function-context
 11:  8bd72945a2f = 11:  8bd72945a2f completion: complete --ignore-matching-lines
 12:  5d32e972a0c = 12:  5d32e972a0c completion: complete --irreversible-delete
 13:  fd94e9ae783 = 13:  fd94e9ae783 completion: complete --ita-invisible-in-index and --ita-visible-in-index
 14:  560ad1cd017 = 14:  560ad1cd017 completion: complete --line-prefix
 15:  d3242e1f949 = 15:  d3242e1f949 completion: complete --no-relative
 16:  0f16a466fd9 = 16:  0f16a466fd9 completion: complete --no-stat
 17:  761c75d4aec = 17:  761c75d4aec completion: complete --output
 18:  f8d430639bc = 18:  f8d430639bc completion: complete --output-indicator-{context,new,old}
 19:  807b8201d14 <  -:  ----------- completion: complete --patch-with-raw
 20:  19507b1a210 = 19:  cbf2e59cbea completion: complete --unified
 21:  c78650f215e = 20:  4750951f120 completion: complete --ws-error-highlight
 22:  040248a3868 = 21:  eda4d407ded completion: move --pickaxe-{all,regex} to __git_diff_common_options
 23:  808e7db20cf = 22:  fb23869dfbb completion: complete --diff-merges, its options and --no-diff-merges
 24:  d5fc5b04b00 = 23:  eb9a6a06914 completion: complete --remerge-diff
 25:  da2cc42cbd4 = 24:  47e81c2add6 diff.c: mention completion above add_diff_options

-- 
gitgitgadget