From: Junio C Hamano Date: Wed, 28 Mar 2018 18:04:24 +0000 (-0700) Subject: Merge branch 'nd/parseopt-completion' X-Git-Tag: v2.17.0-rc2~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/87cc76fa3a79eb86136e55432bd4e4ecc84744cd?hp=-c Merge branch 'nd/parseopt-completion' Hotfix for recently graduated topic that give help to completion scripts from the Git subcommands that are being completed * nd/parseopt-completion: t9902: disable test on the list of merge-strategies under GETTEXT_POISON completion: clear cached --options when sourcing the completion script --- 87cc76fa3a79eb86136e55432bd4e4ecc84744cd diff --combined contrib/completion/git-completion.bash index c7957f0a90,63e34cd588..b09c8a2362 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -280,6 -280,10 +280,10 @@@ __gitcomp ( esac } + # Clear the variables caching builtins' options when (re-)sourcing + # the completion script. + unset $(set |sed -ne 's/^\(__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*\)=.*/\1/p') 2>/dev/null + # This function is equivalent to # # __gitcomp "$(git xxx --git-completion-helper) ..." @@@ -472,7 -476,7 +476,7 @@@ __git_refs ( track="" ;; *) - for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do + for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD; do case "$i" in $match*) if [ -e "$dir/$i" ]; then @@@ -627,7 -631,7 +631,7 @@@ __git_is_configured_remote ( __git_list_merge_strategies () { - git merge -s help 2>&1 | + LANG=C LC_ALL=C git merge -s help 2>&1 | sed -n -e '/[Aa]vailable strategies are: /,/^$/{ s/\.$// s/.*:// @@@ -1105,7 -1109,7 +1109,7 @@@ __git_count_arguments ( } __git_whitespacelist="nowarn warn error error-all fix" -__git_am_inprogress_options="--skip --continue --resolved --abort" +__git_am_inprogress_options="--skip --continue --resolved --abort --quit --show-current-patch" _git_am () { @@@ -1929,11 -1933,11 +1933,11 @@@ _git_rebase ( { __git_find_repo_path if [ -f "$__git_repo_path"/rebase-merge/interactive ]; then - __gitcomp "--continue --skip --abort --quit --edit-todo" + __gitcomp "--continue --skip --abort --quit --edit-todo --show-current-patch" return elif [ -d "$__git_repo_path"/rebase-apply ] || \ [ -d "$__git_repo_path"/rebase-merge ]; then - __gitcomp "--continue --skip --abort --quit" + __gitcomp "--continue --skip --abort --quit --show-current-patch" return fi __git_complete_strategy && return @@@ -2019,7 -2023,7 +2023,7 @@@ _git_send_email ( --compose --confirm= --dry-run --envelope-sender --from --identity --in-reply-to --no-chain-reply-to --no-signed-off-by-cc - --no-suppress-from --no-thread --quiet + --no-suppress-from --no-thread --quiet --reply-to --signed-off-by-cc --smtp-pass --smtp-server --smtp-server-port --smtp-encryption= --smtp-user --subject --suppress-cc= --suppress-from --thread --to @@@ -2967,7 -2971,7 +2971,7 @@@ _git_tag ( while [ $c -lt $cword ]; do i="${words[c]}" case "$i" in - -d|-v) + -d|--delete|-v|--verify) __gitcomp_direct "$(__git_tags "" "$cur" " ")" return ;; @@@ -3005,7 -3009,7 +3009,7 @@@ _git_whatchanged ( _git_worktree () { - local subcommands="add list lock prune unlock" + local subcommands="add list lock move prune remove unlock" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" @@@ -3023,9 -3027,6 +3027,9 @@@ prune,--*) __gitcomp_builtin worktree_prune ;; + remove,--*) + __gitcomp "--force" + ;; *) ;; esac