Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _git: Apply matchspecs to filename completion such as 'git log f/b<TAB>' → 'foo/bar.txt's
- X-seq: zsh-workers 36957
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _git: Apply matchspecs to filename completion such as 'git log f/b<TAB>' → 'foo/bar.txt's
- Date: Sun, 25 Oct 2015 18:33:51 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=YwG ih47dXFP1M3/u/nPwiqvHGEI=; b=VWyxgtpYGrm+TojBUCnCamHTwYH3izqFlYr mYF4wob+PDSbw+vHIl3DPwY6LZT6UN0bm9V1/Jh2jh11sjprVDLnGm6Ij6xHz/yz px3OgRB7QIVV6o9FALORkg+0V8sTDbssnwanns/E6JBDcdC6vR5yysddF2M6Cwre VNMf7284=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Yw Gih47dXFP1M3/u/nPwiqvHGEI=; b=TGotVRSdLXUMwXX/ktrcG4v11FXjXoZ1wy bfsTp462A1QZPmYQyAEowScah9ljIga4HqBOte4pXtgGyYW8u+X25R7vl6E/Dmpg 8Kyc3gPysKJiQltfD0CEjsXHycIksJB0eSoAYj6nb2fgYr3MHUJo98fveNEY5xcV 6NbaVZOBE=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author