summaryrefslogtreecommitdiff
path: root/exec-cmd.c
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2021-03-24 08:36:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-24 17:05:47 (GMT)
commit61318078640dc1bbe07c5d762f7a581b7408d623 (patch)
tree36b497ae09077b0a95e55983b09a07d032e0228c /exec-cmd.c
parent42b30bcbb7929527631225a89a5630057535d766 (diff)
downloadgit-61318078640dc1bbe07c5d762f7a581b7408d623.zip
git-61318078640dc1bbe07c5d762f7a581b7408d623.tar.gz
git-61318078640dc1bbe07c5d762f7a581b7408d623.tar.bz2
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 'exec-cmd.c')
0 files changed, 0 insertions, 0 deletions