bash completion: add basic support for git-reflog
PATCH RESEND v2 1/1 bash completion: add basic support for git-reflog
"Promote" the reflog command out of plumbing, so that we now run completion for it. After all, it's listed under porcelain (ancillary), and we do run completion for those commands.
Add basic completion for the three subcommands - show, expire, delete. Try completing refs for these too.
---
resend note:
This didn't seem to have been picked up. FYI, Johnathan made a comment, but it was non-blocking, so I didn't change anything.
Changed from v1:
- picked up Gábor's suggestion on using __git_find_on_cmdline() to correctly handle situations where subcommands are used with dashed options.
- don't "hide" reflog anymore - run completion for it too.
Gábor: hmm, it really seems that reflog is treated as plumbing - no completion is done for it. Even get-tar-commit-id (I've never used this before) is treated better than reflog. Shall do something about it!
contrib/completion/git-completion.bash | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
contrib/completion/git-completion.bash +12 -1
@@ -735,7 +735,6 @@ __git_list_porcelain_commands () quiltimport) : import;; read-tree) : plumbing;; receive-pack) : plumbing;; - reflog) : plumbing;; remote-*) : transport;; repo-config) : deprecated;; rerere) : plumbing;;
@@ -1632,6 +1631,18 @@ _git_rebase () __gitcomp "$(__git_refs)" } +_git_reflog () +{ + local subcommands="show delete expire" + local subcommand="$(__git_find_on_cmdline "$subcommands")" + + if [ -z "$subcommand" ]; then + __gitcomp "$subcommands" + else + __gitcomp "$(__git_refs)" + fi +} + __git_send_email_confirm_options="always never auto cc compose" __git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all"
Signature · 1 line
1.7.3.2.493.g2b058
Quoted 3 lines · Tay Ray Chuan
"Promote" the reflog command out of plumbing, so that we now run completion for it. After all, it's listed under porcelain (ancillary), and we do run completion for those commands.
Good point.
[...]
Quoted 2 lines
Even get-tar-commit-id (I've never used this before) is treated better than reflog.
It's handy from time to time. :)
Thanks, and sorry to miss the point before. The patch looks good.