* [RFC PATCH 1/2] completion: add bash completion for 'git rev-list'
@ 2017-03-03 12:35 Denton Liu
0 siblings, 0 replies; only message in thread
From: Denton Liu @ 2017-03-03 12:35 UTC (permalink / raw)
To: git
Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
This patch isn't strictly necessary since 'git rev-list' isn't a porcelain
command. However, it might be nice to include in case users interactively call
'git rev-list' anyway.
---
contrib/completion/git-completion.bash | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 41ee52991..412485369 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2499,6 +2499,36 @@ _git_revert ()
__gitcomp_nl "$(__git_refs)"
}
+__git_rev_list_options="
+ --max-count= --skip= --max-age= --min-age= --sparse --merges --no-merges
+ --min-parents= --no-min-parents --max-parents= --no-max-parents --first-parent
+ --remove-empty --full-history --not --all --branches= --tags= --remotes=
+ --glob= --ignore-missing --stdin --quiet --topo-order --parents --timestamp
+ --left-right --left-only --right-only --cherry-mark --cherry-pick --encoding=
+ --author= --committer= --grep= --regexp-ignore-case --extended-regexp
+ --fixed-strings --date= --objects --objects-edge --objects-edge-aggressive
+ --unpacked --pretty --header --bisect --bisect-vars --bisect-all --merge
+ --reverse --walk-reflogs --no-walk --do-walk --count --use-bitmap-index
+"
+
+__git_complete_rev_list_command ()
+{
+ case "$cur" in
+ --*)
+ __gitcomp "$__git_rev_list_options"
+ return 0
+ ;;
+ esac
+ return 1
+}
+
+_git_rev_list ()
+{
+ __git_has_doubledash && return
+
+ __git_complete_rev_list_command || __gitcomp_nl "$(__git_refs)"
+}
+
_git_rm ()
{
case "$cur" in
--
2.12.0.1.g5415fdfc5.dirty
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-03 18:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03 12:35 [RFC PATCH 1/2] completion: add bash completion for 'git rev-list' Denton Liu
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).