zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Adrian Vollmer <zsh@vollmer.syss.de>
Cc: zsh-workers@zsh.org
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	[thread overview]
Message-ID: <F03D392D-4496-4AD8-B196-BE8316799C62@dana.is> (raw)
In-Reply-To: <20190307192305.GA3173@av.sy.gs>

On 7 Mar 2019, at 13:23, Adrian Vollmer <zsh@vollmer.syss.de> 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


  reply	other threads:[~2019-03-07 23:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 19:23 Adrian Vollmer
2019-03-07 23:27 ` dana [this message]
2019-03-08 20:22   ` Daniel Shahaf
2019-03-09 16:25     ` dana
2019-03-09 16:43       ` Daniel Shahaf
2019-03-09 23:37         ` dana
2019-03-10 16:20           ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F03D392D-4496-4AD8-B196-BE8316799C62@dana.is \
    --to=dana@dana.is \
    --cc=zsh-workers@zsh.org \
    --cc=zsh@vollmer.syss.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).