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

[PATCH] git-completion.bash: update obsolete code.

From
Manlio Perillo <manlio.perillo@gmail.com>
Date
Dec 16, 2012, 21:50 UTC
Message-ID
<1355694602-8771-1-git-send-email-manlio.perillo@gmail.com>

The git-completion.bash script was using the git ls-tree command without the --name-only option, with a sed filter to parse path names; use the --name-only option, instead.

Signed-off-by: Manlio Perillo <manlio.perillo@gmail.com>
---
 contrib/completion/git-completion.bash | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0b77eb1..85d9051 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -397,20 +397,7 @@ __git_complete_revlist_file ()
 		*)   pfx="$ref:$pfx" ;;
 		esac
 
-		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
-				| sed '/^100... blob /{
-				           s,^.*	,,
-				           s,$, ,
-				       }
-				       /^120000 blob /{
-				           s,^.*	,,
-				           s,$, ,
-				       }
-				       /^040000 tree /{
-				           s,^.*	,,
-				           s,$,/,
-				       }
-				       s/^.*	//')" \
+		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree --name-only "$ls")" \
 			"$pfx" "$cur_" ""
 		;;
 	*...*)
-- 
1.8.1.rc1.18.g9db0d25
Next: Junio C Hamano
Message 1 of 5 in “git-completion.bash: update obsolete code.”
  1. git-completion.bash: update obsolete code.Manlio Perillo, Dec 16, 2012
  2. Junio C HamanoDec 17, 2012
  3. Manlio PerilloDec 17, 2012
  4. Junio C HamanoDec 17, 2012
  5. Junio C HamanoDec 18, 2012

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.