diff options
author | Denton Liu <liu.denton@gmail.com> | 2021-03-24 01:36:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-24 10:05:47 -0700 |
commit | 61318078640dc1bbe07c5d762f7a581b7408d623 (patch) | |
tree | 36b497ae09077b0a95e55983b09a07d032e0228c /progress.c | |
parent | git-completion.bash: extract from else in _git_stash() (diff) | |
download | tgif-61318078640dc1bbe07c5d762f7a581b7408d623.tar.xz |
git-completion.bash: use __gitcomp_builtin() in _git_stash()
The completion for 'git stash' has not changed in a major way since it
was converted from shell script to builtin. Now that it's a builtin, we
can take advantage of the groundwork laid out by parse-options and use
the generated options.
Rewrite _git_stash() to take use __gitcomp_builtin() to generate
completions for subcommands.
The main `git stash` command does not take any arguments directly. If no
subcommand is given, it automatically defaults to `git stash push`. This
means that we can simplify the logic for when no subcommands have been
given yet. We only have to offer subcommand completions when we're
completing a non-option after "stash".
One area that this patch could improve upon is that the `git stash list`
command accepts log-options. It would be nice if the completion for this
were unified with that of _git_log() and _git_show() which would allow
completions to be provided for options such as `--pretty` but that is
outside the scope of this patch.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'progress.c')
0 files changed, 0 insertions, 0 deletions