[PATCH v2 00/25] completion: add missing diff options
- From
Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jun 12, 2023, 12:52 UTC
- Message-ID
- <pull.1543.v2.git.1686574374.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1543.git.1686428484.gitgitgadget@gmail.com>
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.txtThe 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 (25):
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 --patch-with-raw
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_optionscontrib/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-v2 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1543/phil-blain/completion-common-diff-v2 Pull-Request: https://github.com/gitgitgadget/git/pull/1543
Range-diff vs v1:
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 = 19: 807b8201d14 completion: complete --patch-with-raw
20: 19507b1a210 = 20: 19507b1a210 completion: complete --unified
21: f8246a2a581 ! 21: c78650f215e completion: complete --ws-error-highlight
@@
## Metadata ##
-Author: Philippe Blain <philippe.blain@canada.ca>
+Author: Philippe Blain <levraiphilippeblain@gmail.com>
## Commit message ##
completion: complete --ws-error-highlight
22: cbe0c1b3e5f = 22: 040248a3868 completion: move --pickaxe-{all,regex} to __git_diff_common_options
23: 5dc1e541d16 ! 23: 808e7db20cf completion: complete --diff-merges, its options and --no-diff-merges
@@ Metadata
## Commit message ##
completion: complete --diff-merges, its options and --no-diff-merges
- The flgs --[no-]diff-merges only make sense for 'git log' and 'git
+ The flags --[no-]diff-merges only make sense for 'git log' and 'git
show', so add a new variable __git_log_show_options for options only
relevant to these two commands, and add them there. Also add
__git_diff_merges_opts and list the accepted values for --diff-merges,
24: d66068db0a4 = 24: d5fc5b04b00 completion: complete --remerge-diff
25: 93b6233f0dd ! 25: da2cc42cbd4 diff.c: mention completion above add_diff_options
@@ diff.c: static int diff_opt_rotate_to(const struct option *opt, const char *arg,
return 0;
}
-+/* Consider adding new flags to __git_diff_common_options
++/*
++ * Consider adding new flags to __git_diff_common_options
+ * in contrib/completion/git-completion.bash
+ */
struct option *add_diff_options(const struct option *opts,-- gitgitgadget