From: Tay Ray Chuan <rctay89@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"SZEDER Gábor" <szeder@ira.uka.de>,
"Jonathan Nieder" <jrnieder@gmail.com>
Subject: [PATCH v2 resend] bash completion: add basic support for git-reflog
Date: Thu, 16 Dec 2010 14:56:08 +0800 [thread overview]
Message-ID: <20101216145608.000004df@unknown> (raw)
"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.
Helped-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
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(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index f710469..6732b1d 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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"
--
1.7.3.2.493.g2b058
next reply other threads:[~2010-12-16 6:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 6:56 Tay Ray Chuan [this message]
2010-12-16 7:15 ` [PATCH v2 resend] bash completion: add basic support for git-reflog Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101216145608.000004df@unknown \
--to=rctay89@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=szeder@ira.uka.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).