Skip to content

Commit e392382

Browse files
committed
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
2 parents cda8faa + aeeb978 commit e392382

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

contrib/completion/git-completion.bash

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,10 +1250,7 @@ _git_archive ()
12501250
return
12511251
;;
12521252
--*)
1253-
__gitcomp "
1254-
--format= --list --verbose
1255-
--prefix= --remote= --exec= --output
1256-
"
1253+
__gitcomp_builtin archive "--format= --list --verbose --prefix= --worktree-attributes"
12571254
return
12581255
;;
12591256
esac
@@ -2017,15 +2014,18 @@ _git_range_diff ()
20172014
__git_complete_revlist
20182015
}
20192016

2017+
__git_rebase_inprogress_options="--continue --skip --abort --quit --show-current-patch"
2018+
__git_rebase_interactive_inprogress_options="$__git_rebase_inprogress_options --edit-todo"
2019+
20202020
_git_rebase ()
20212021
{
20222022
__git_find_repo_path
20232023
if [ -f "$__git_repo_path"/rebase-merge/interactive ]; then
2024-
__gitcomp "--continue --skip --abort --quit --edit-todo --show-current-patch"
2024+
__gitcomp "$__git_rebase_interactive_inprogress_options"
20252025
return
20262026
elif [ -d "$__git_repo_path"/rebase-apply ] || \
20272027
[ -d "$__git_repo_path"/rebase-merge ]; then
2028-
__gitcomp "--continue --skip --abort --quit --show-current-patch"
2028+
__gitcomp "$__git_rebase_inprogress_options"
20292029
return
20302030
fi
20312031
__git_complete_strategy && return
@@ -2035,19 +2035,8 @@ _git_rebase ()
20352035
return
20362036
;;
20372037
--*)
2038-
__gitcomp "
2039-
--onto --merge --strategy --interactive
2040-
--rebase-merges --preserve-merges --stat --no-stat
2041-
--committer-date-is-author-date --ignore-date
2042-
--ignore-whitespace --whitespace=
2043-
--autosquash --no-autosquash
2044-
--fork-point --no-fork-point
2045-
--autostash --no-autostash
2046-
--verify --no-verify --keep-base
2047-
--keep-empty --root --force-rebase --no-ff
2048-
--rerere-autoupdate
2049-
--exec
2050-
"
2038+
__gitcomp_builtin rebase "" \
2039+
"$__git_rebase_interactive_inprogress_options"
20512040

20522041
return
20532042
esac

0 commit comments

Comments
 (0)