Skip to content

Commit 32e64e5

Browse files
pcloudsgitster
authored andcommitted
completion: use __gitcomp_builtin in _git_pull
This is really nice. Since pull_options[] already declares all passthru options to 'merge' or 'fetch', a single git pull --git-completion-helper would provide all completable options (--no- variants are a separate issue). Dead shell variables can now be deleted. New completable options are: --allow-unrelated-histories --ipv4 --ipv6 --jobs --refmap= --signoff --strategy-option= Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7a60e3b commit 32e64e5

1 file changed

Lines changed: 5 additions & 20 deletions

File tree

contrib/completion/git-completion.bash

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,12 +1448,6 @@ _git_difftool ()
14481448

14491449
__git_fetch_recurse_submodules="yes on-demand no"
14501450

1451-
__git_fetch_options="
1452-
--quiet --verbose --append --upload-pack --force --keep --depth=
1453-
--tags --no-tags --all --prune --dry-run --recurse-submodules=
1454-
--unshallow --update-shallow
1455-
"
1456-
14571451
_git_fetch ()
14581452
{
14591453
case "$cur" in
@@ -1754,14 +1748,6 @@ _git_log ()
17541748
__git_complete_revlist
17551749
}
17561750

1757-
# Common merge options shared by git-merge(1) and git-pull(1).
1758-
__git_merge_options="
1759-
--no-commit --no-stat --log --no-log --squash --strategy
1760-
--commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit
1761-
--verify-signatures --no-verify-signatures --gpg-sign
1762-
--quiet --verbose --progress --no-progress
1763-
"
1764-
17651751
_git_merge ()
17661752
{
17671753
__git_complete_strategy && return
@@ -1887,12 +1873,11 @@ _git_pull ()
18871873
return
18881874
;;
18891875
--*)
1890-
__gitcomp "
1891-
--rebase --no-rebase
1892-
--autostash --no-autostash
1893-
$__git_merge_options
1894-
$__git_fetch_options
1895-
"
1876+
__gitcomp_builtin pull "--no-autostash --no-commit --no-edit
1877+
--no-ff --no-log --no-progress --no-rebase
1878+
--no-squash --no-stat --no-tags
1879+
--no-verify-signatures"
1880+
18961881
return
18971882
;;
18981883
esac

0 commit comments

Comments
 (0)