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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <peff@xxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]