Skip to content

Commit d49dffd

Browse files
maxrothmangitster
authored andcommitted
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 <[email protected]> Acked-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f1d4a28 commit d49dffd

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

contrib/completion/git-completion.bash

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,8 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
14761476
--dirstat-by-file= --cumulative
14771477
--diff-algorithm=
14781478
--submodule --submodule= --ignore-submodules
1479+
--indent-heuristic --no-indent-heuristic
1480+
--textconv --no-textconv
14791481
"
14801482

14811483
_git_diff ()
@@ -1784,23 +1786,30 @@ _git_log ()
17841786
__gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
17851787
return
17861788
;;
1789+
--no-walk=*)
1790+
__gitcomp "sorted unsorted" "" "${cur##--no-walk=}"
1791+
return
1792+
;;
17871793
--*)
17881794
__gitcomp "
17891795
$__git_log_common_options
17901796
$__git_log_shortlog_options
17911797
$__git_log_gitk_options
17921798
--root --topo-order --date-order --reverse
17931799
--follow --full-diff
1794-
--abbrev-commit --abbrev=
1800+
--abbrev-commit --no-abbrev-commit --abbrev=
17951801
--relative-date --date=
17961802
--pretty= --format= --oneline
17971803
--show-signature
17981804
--cherry-mark
17991805
--cherry-pick
18001806
--graph
1801-
--decorate --decorate=
1807+
--decorate --decorate= --no-decorate
18021808
--walk-reflogs
1809+
--no-walk --no-walk= --do-walk
18031810
--parents --children
1811+
--expand-tabs --expand-tabs= --no-expand-tabs
1812+
--patch
18041813
$merge
18051814
$__git_diff_common_options
18061815
--pickaxe-all --pickaxe-regex
@@ -2580,8 +2589,9 @@ _git_show ()
25802589
return
25812590
;;
25822591
--*)
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
25852595
$__git_diff_common_options
25862596
"
25872597
return

0 commit comments

Comments
 (0)