completion: add missing completions for log, diff, show
The bash completion script knows some options to "git log" and "git show" only in the positive form, (e.g. "--abbrev-commit"), but not in their negative form (e.g. "--no-abbrev-commit"). Add them. Also, the bash completion script is missing some other options to "git diff", and "git show" (and thus, all other commands that take "git diff"'s options). Add them. Of note, since "--indent-heuristic" is no longer experimental, add that too. Signed-off-by: Max Rothman <max.r.rothman@gmail.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Max Rothman committed
Jul 2, 2019 at 01:56 UTC
d49dffde9a3964dce2412ea912b712df212e7046
1 file changed
+14
-4
contrib/completion/git-completion.bash
+14
-4
@@ -1476,6 +1476,8 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
1476
--dirstat-by-file= --cumulative
1477
--diff-algorithm=
1478
--submodule --submodule= --ignore-submodules
1479
+ --indent-heuristic --no-indent-heuristic
1480
+ --textconv --no-textconv
1481
"
1482
1483
_git_diff ()
@@ -1784,6 +1786,10 @@ _git_log ()
1786
__gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
1787
return
1788
;;
1789
+ --no-walk=*)
1790
+ __gitcomp "sorted unsorted" "" "${cur##--no-walk=}"
1791
+ return
1792
+ ;;
1793
--*)
1794
__gitcomp "
1795
$__git_log_common_options
@@ -1791,16 +1797,19 @@ _git_log ()
1797
$__git_log_gitk_options
1798
--root --topo-order --date-order --reverse
1799
--follow --full-diff
1794
- --abbrev-commit --abbrev=
1800
+ --abbrev-commit --no-abbrev-commit --abbrev=
1801
--relative-date --date=
1802
--pretty= --format= --oneline
1803
--show-signature
1804
--cherry-mark
1805
--cherry-pick
1806
--graph
1801
- --decorate --decorate=
1807
+ --decorate --decorate= --no-decorate
1808
--walk-reflogs
1809
+ --no-walk --no-walk= --do-walk
1810
--parents --children
1811
+ --expand-tabs --expand-tabs= --no-expand-tabs
1812
+ --patch
1813
$merge
1814
$__git_diff_common_options
1815
--pickaxe-all --pickaxe-regex
@@ -2580,8 +2589,9 @@ _git_show ()
2589
return
2590
;;
2591
--*)
2583
- __gitcomp "--pretty= --format= --abbrev-commit --oneline
2584
- --show-signature
2592
+ __gitcomp "--pretty= --format= --abbrev-commit --no-abbrev-commit
2593
+ --oneline --show-signature --patch
2594
+ --expand-tabs --expand-tabs= --no-expand-tabs
2595
$__git_diff_common_options
2596
"
2597
return