zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] _git: Apply matchspecs to filename completion such as 'git log f/b<TAB>' → 'foo/bar.txt's
@ 2015-10-25 18:33 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2015-10-25 18:33 UTC (permalink / raw)
  To: zsh-workers

This patch makes 'git log S/e<TAB>' expand to Src/exec.c.  The incumbent
code would run 'git ls-tree S/' and find no matches.
---
I realize this makes the output size O(tree) (index lookups, not
readdir()s).  If this turns out to be a problem for larger repositories,
I assume either the listing could be made smarter (list the tree to a more
limited depth or breadth) or the result cached.

 Completion/Unix/Command/_git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 719d717..ecf3fcb 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6071,7 +6071,7 @@ __git_tree_files () {
   shift
   (( at_least_one_tree_added = 0 ))
   for tree in $*; do
-    tree_files+=(${(ps:\0:)"$(_call_program tree-files git ls-tree $extra_args --name-only -z $tree $Path 2>/dev/null)"})
+    tree_files+=(${(ps:\0:)"$(_call_program tree-files git ls-tree -r $extra_args --name-only -z $tree 2>/dev/null)"})
     __git_command_successful $pipestatus && (( at_least_one_tree_added = 1 ))
   done
 
-- 
2.1.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-25 18:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-25 18:33 [PATCH] _git: Apply matchspecs to filename completion such as 'git log f/b<TAB>' → 'foo/bar.txt's Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).