git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] completion: use __gitcomp_nl() for completing refs

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Mar 22, 2015, 12:03 UTC
Message-ID
<1427025791-51676-1-git-send-email-szeder@ira.uka.de>

We do that almost everywhere, because it's faster for large number of refs, see a31e62629 (completion: optimize refs completion, 2011-10-15). These were the last two places where we still used __gitcomp() for completing refs.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 731c289..be85438 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -977,7 +977,7 @@ _git_branch ()
 
 	case "$cur" in
 	--set-upstream-to=*)
-		__gitcomp "$(__git_refs)" "" "${cur##--set-upstream-to=}"
+		__gitcomp_nl "$(__git_refs)" "" "${cur##--set-upstream-to=}"
 		;;
 	--*)
 		__gitcomp "
@@ -1045,7 +1045,7 @@ _git_checkout ()
 
 _git_cherry ()
 {
-	__gitcomp "$(__git_refs)"
+	__gitcomp_nl "$(__git_refs)"
 }
 
 _git_cherry_pick ()
-- 
1.9.5.msysgit.0
Message 1 of 1 in “completion: use __gitcomp_nl() for completing refs”
  1. completion: use __gitcomp_nl() for completing refsSZEDER Gábor, Mar 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.