From: cornelius.weig@tngtech.com
To: git@vger.kernel.org
Cc: szeder.dev@gmail.com, j6t@kdbg.org,
Cornelius Weig <cornelius.weig@tngtech.com>
Subject: [PATCH v2 4/7] completion: teach ls-remote to complete options
Date: Fri, 3 Feb 2017 12:01:56 +0100 [thread overview]
Message-ID: <20170203110159.377-5-cornelius.weig@tngtech.com> (raw)
In-Reply-To: <20170203110159.377-1-cornelius.weig@tngtech.com>
From: Cornelius Weig <cornelius.weig@tngtech.com>
ls-remote needs to complete remote names and its own options. In
addition to the existing remote name completions, do also complete
the options --heads, --tags, --refs, --get-url, and --symref.
Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
---
contrib/completion/git-completion.bash | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 652c7e2..a355eeb 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1449,6 +1449,12 @@ _git_ls_files ()
_git_ls_remote ()
{
+ case "$cur" in
+ --*)
+ __gitcomp "--heads --tags --refs --get-url --symref"
+ return
+ ;;
+ esac
__gitcomp_nl "$(__git_remotes)"
}
--
2.10.2
next prev parent reply other threads:[~2017-02-03 11:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 11:01 [PATCH v2 0/7] completion bash: add more options and commands cornelius.weig
2017-02-03 11:01 ` [PATCH v2 1/7] completion: teach submodule subcommands to complete options cornelius.weig
2017-02-03 11:01 ` [PATCH v2 2/7] completion: add subcommand completion for rerere cornelius.weig
2017-02-03 11:01 ` [PATCH v2 3/7] completion: improve bash completion for git-add cornelius.weig
2017-02-03 11:01 ` cornelius.weig [this message]
2017-02-03 11:01 ` [PATCH v2 5/7] completion: teach replace to complete options cornelius.weig
2017-02-03 11:01 ` [PATCH v2 6/7] completion: teach remote subcommands " cornelius.weig
2017-02-03 11:01 ` [PATCH v2 7/7] completion: recognize more long-options cornelius.weig
2017-02-06 21:29 ` [PATCH v2 0/7] completion bash: add more options and commands Junio C Hamano
2017-02-07 9:00 ` Johannes Sixt
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=20170203110159.377-5-cornelius.weig@tngtech.com \
--to=cornelius.weig@tngtech.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=szeder.dev@gmail.com \
/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).