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>
Nguyễn Thái Ngọc Duy committed
Feb 9, 2018 at 18:02 UTC
32e64e507bb294ae7828f0ab265ffbde5dc28566
1 file changed
+5
-20
contrib/completion/git-completion.bash
+5
-20
@@ -1448,12 +1448,6 @@ _git_difftool ()
1448
1449
__git_fetch_recurse_submodules="yes on-demand no"
1450
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
-
1451
_git_fetch ()
1452
{
1453
case "$cur" in
@@ -1754,14 +1748,6 @@ _git_log ()
1748
__git_complete_revlist
1749
}
1750
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
-
1751
_git_merge ()
1752
{
1753
__git_complete_strategy && return
@@ -1887,12 +1873,11 @@ _git_pull ()
1873
return
1874
;;
1875
--*)
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
+
1881
return
1882
;;
1883
esac