Thread (15 messages) flat view 15 messages, 2 authors, 2016-06-15

[PATCHv2 4/3] completion: use __gitcomp_nl for ctag matching

From: Jeff King <hidden>
Date: 2016-06-15 22:52:18
Subsystem: the rest · Maintainer: Linus Torvalds

On Fri, Oct 21, 2011 at 01:30:21PM -0400, Jeff King wrote:
+		if test -r tags; then
+			__gitcomp "$(__git_match_ctag "$cur" tags)"
+			return
+		fi
Once this is merged with sg/complete-refs, this can be applied on top:

-- >8 --
Subject: [PATCH] completion: use __gitcomp_nl for ctag matching

It's much faster than __gitcomp for large numbers of matches
(which ctags often have; there are almost 10,000 matches for
"" in git.git).

Signed-off-by: Jeff King <redacted>
---
As an aside, this is one of those patches that is easier to review using
"diff-highlight" from patch 1 of this series.

 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 391c054..53d3dcb 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1473,7 +1473,7 @@ _git_grep ()
 	case "$cword,$prev" in
 	2,*|*,-*)
 		if test -r tags; then
-			__gitcomp "$(__git_match_ctag "$cur" tags)"
+			__gitcomp_nl "$(__git_match_ctag "$cur" tags)"
 			return
 		fi
 		;;
-- 
1.7.7.rc1.28.g5dd2ee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help