Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _git: Complete files after 'reset' when there are no commits, when the 'verbose' style is set.
- X-seq: zsh-workers 41475
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _git: Complete files after 'reset' when there are no commits, when the 'verbose' style is set.
- Date: Mon, 31 Jul 2017 00:59:33 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=gdizC7 /C+Qfe34ikURYA0KElTPNqOlMCpl8dveWpXX0=; b=XBl/LbwXp2GvdoRY/v7iRa jvsjUXJL0/oIj63xhSMOsga4EhWPOkXbONl6PKguJerLE0WivmcOVzbRU40wXTQR nvbFmF7J2MrUD4htJ7bskUuHjE4VwJm3PEI+rabCGc4iyX8YVCiI+ghjX45/n1DW gvnrSwlx7J3yR+2PSJygMF1f4FHWsbRc/12k85g3eIi2nkCSbWwtD7lCvJEltmR7 LRc+zEIQc/mrIySh5bTy+bZbcK7VQ/5p48FpCFOTB7sVZK1WbqTonwHmstZ5XFcd sZ4d4PidBLAXThrp7SrwZAfE6jUesUQOW4JotgSPldzMCktrel0o/dODOyr4jkOQ ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=gdizC7 /C+Qfe34ikURYA0KElTPNqOlMCpl8dveWpXX0=; b=qW+Kgi8/neGkBB1GdIPaik eDMqZICF2FmSlf/4i5R/o8MsoWzojvKtAQ8Rl98GlPNBhvSn8ZKbDlw6GGA7dWTI jQ9WuAAl6Mx3hhhVt+1/G3i7dqlMbZlCVVMe8W+ovTarS5nyenb9pb7cNiOrw03y LKH8aXPqPGkNmBXUAlKwiG54AbGCx6mnC5WDxRz3OtaH3VmpLZFdix3oa++DwcNs LmINOmj2NTQulp07hc2E0uCj98gblNGvwkH+0pi+e8xpvi25upV0CcYX7XjCOGn3 73/uZw2HF3l20mPtbcJtEo1HFLU9g2k+tVZppz94iAlmHEgwQJHxrzxiXZedWHSA ==
- 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
---
Completion/Unix/Command/_git | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index ce8a4049d..032cbad1e 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1462,6 +1462,12 @@ _git-reset () {
case $state in
(file)
local tree=HEAD
+ if zstyle -t :completion:${curcontext}: verbose; then
+ if ! _call_program headed git rev-parse --verify HEAD 2>/dev/null; then
+ # well-known sha1 of the empty tree
+ tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+ fi
+ fi
if [[ -n $line[1] ]] && __git_is_treeish $line[1]; then
tree=$line[1]
fi
That magic value has been used by vcs_info for a while.
I opted for making this conditional upon 'verbose' since this is a bit of an
edge case, and forks aren't free everywhere.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author