summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-10-07 02:32:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-07 02:32:55 (GMT)
commite392382f95fe8d3c15cf88453acb92a93fc5a942 (patch)
tree3bec1aad318ca63d3f825fc222f6b19f48009e3f /contrib
parentcda8faa37e997f5db3458c1454ffe70f5c460d2a (diff)
parentaeeb978ba6c757dddc1097fc4de96c0bc1c1e338 (diff)
downloadgit-e392382f95fe8d3c15cf88453acb92a93fc5a942.zip
git-e392382f95fe8d3c15cf88453acb92a93fc5a942.tar.gz
git-e392382f95fe8d3c15cf88453acb92a93fc5a942.tar.bz2
Merge branch 'dl/complete-rebase-and-archive'
The command line completion for "git archive" and "git rebase" are now made less prone to go out of sync with the binary. * dl/complete-rebase-and-archive: completion: teach archive to use __gitcomp_builtin completion: teach rebase to use __gitcomp_builtin
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash27
1 files changed, 8 insertions, 19 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 59cd3e8..388f4dd 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1250,10 +1250,7 @@ _git_archive ()
return
;;
--*)
- __gitcomp "
- --format= --list --verbose
- --prefix= --remote= --exec= --output
- "
+ __gitcomp_builtin archive "--format= --list --verbose --prefix= --worktree-attributes"
return
;;
esac
@@ -2017,15 +2014,18 @@ _git_range_diff ()
__git_complete_revlist
}
+__git_rebase_inprogress_options="--continue --skip --abort --quit --show-current-patch"
+__git_rebase_interactive_inprogress_options="$__git_rebase_inprogress_options --edit-todo"
+
_git_rebase ()
{
__git_find_repo_path
if [ -f "$__git_repo_path"/rebase-merge/interactive ]; then
- __gitcomp "--continue --skip --abort --quit --edit-todo --show-current-patch"
+ __gitcomp "$__git_rebase_interactive_inprogress_options"
return
elif [ -d "$__git_repo_path"/rebase-apply ] || \
[ -d "$__git_repo_path"/rebase-merge ]; then
- __gitcomp "--continue --skip --abort --quit --show-current-patch"
+ __gitcomp "$__git_rebase_inprogress_options"
return
fi
__git_complete_strategy && return
@@ -2035,19 +2035,8 @@ _git_rebase ()
return
;;
--*)
- __gitcomp "
- --onto --merge --strategy --interactive
- --rebase-merges --preserve-merges --stat --no-stat
- --committer-date-is-author-date --ignore-date
- --ignore-whitespace --whitespace=
- --autosquash --no-autosquash
- --fork-point --no-fork-point
- --autostash --no-autostash
- --verify --no-verify --keep-base
- --keep-empty --root --force-rebase --no-ff
- --rerere-autoupdate
- --exec
- "
+ __gitcomp_builtin rebase "" \
+ "$__git_rebase_interactive_inprogress_options"
return
esac