git/contrib/completion
Denton Liu 6131807864 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>
2021-03-24 10:05:47 -07:00
..
.gitattributes completion: mark bash script as LF-only 2017-05-10 13:32:51 +09:00
git-completion.bash git-completion.bash: use __gitcomp_builtin() in _git_stash() 2021-03-24 10:05:47 -07:00
git-completion.tcsh git-completion.tcsh: fix redirect with noclobber 2015-06-09 11:21:15 -07:00
git-completion.zsh completion: zsh: fix file completion regression 2020-12-01 10:32:40 -08:00
git-prompt.sh Merge branch 'sd/prompt-local-variable' 2020-11-11 13:18:38 -08:00