Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug in git tab completion: If git.showSignature = true is set globally, tab completion of commits is garbled
- X-seq: zsh-workers 44103
- From: dana <dana@xxxxxxx>
- To: Adrian Vollmer <zsh@xxxxxxxxxxxxxxx>
- Subject: Re: Bug in git tab completion: If git.showSignature = true is set globally, tab completion of commits is garbled
- Date: Thu, 7 Mar 2019 17:27:17 -0600
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GmYwLDtbxFpIu/JXa+B6m9H2x8bahyuU2PhfAN40CVM=; b=Oh55RKRuR1duxzFGZ75ye/HMCKDNH8HMg8sC1mF57jJIOnK+tFLbE82cWQbuDKC14S AcjLMxobnIycyBmYyhR9vtHrbrDmyWn8KVyek3xZkybsT5b9l1/UJskDlToOOtgEFvPW Bz+tEPVZ8nc4FP8JzzWyLUXLVa7SlZzv1ckuDL10icRQddIs89b21hpPgcJ/Sjv0Ka08 nFfLw9CtTSmGB86uhNycZ8pWCbF8HfCbU6jMOBwHt0c/wf/N8wBueqpNWkEqubb6n7GF ZI7qMhFyFSoobtapibTA+5I7FCLtNC6EMMqkvaqoQtceHn4Ows8tsRMZCyJC3O1jHPDG YJsw==
- In-reply-to: <20190307192305.GA3173@av.sy.gs>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20190307192305.GA3173@av.sy.gs>
On 7 Mar 2019, at 13:23, Adrian Vollmer <zsh@xxxxxxxxxxxxxxx> wrote:
>to reproduce this bug, set showSignature = true in the log section of
>your global git config file, then type git reset <TAB> in a git repo
>that has a recent signed commit in its history.
I guess this is the simple fix for this particular case. `git log` is called
in a few other places, too, but i'm not sure if they're problematic. Probably
are and i just don't know how to trigger it.
Maybe it would make sense to do something more robust instead, though? For
example, we could have a __git_call wrapper around _call_program that always
calls git with a safe set of -c options, &c. It'd be a lot of lines changed,
but any further issues like this could be fixed in one place. idk.
dana
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index e5e4ee768..796a98fd5 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6517,7 +6517,7 @@ __git_recent_commits () {
# Careful: most %d will expand to the empty string. Quote properly!
# NOTE: we could use %D directly, but it's not available in git 1.9.1 at least.
- commits=("${(f)"$(_call_program commits git --no-pager log ${(q)commit_opts} -20 --format='%h%n%d%n%s\ \(%cr\)%n%p')"}")
+ commits=("${(f)"$(_call_program commits git -c log.showSignature=false --no-pager log ${(q)commit_opts} -20 --format='%h%n%d%n%s\ \(%cr\)%n%p')"}")
__git_command_successful $pipestatus || return 1
for i j k parents in "$commits[@]" ; do
Messages sorted by:
Reverse Date,
Date,
Thread,
Author