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



dana wrote on Sat, Mar 09, 2019 at 17:37:47 -0600:
> On 9 Mar 2019, at 10:43, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> >Huh.  Odd, but I think we can live with that: we can just have _git
> >discard the hardcoded header line that git emits.  All we really care
> >about is that future git versions will continue to emit that line.  I
> >assume they will, for compatibility reasons.
> 
> In that case, i think it would be something like this? I didn't test very
> extensively (not even sure which paths exactly lead to these commands), but it
> does seem to work for the scenario at hand

Looks good.  Thanks.  More below regarding the codepaths to these.

> +++ b/Completion/Unix/Command/_git
> @@ -5652,7 +5652,7 @@ __git_describe_branch () {

Looking at the callers of this, it should be used by «git checkout <TAB>» (one
of the alternatives is "basenames" of remote branches), refspecs in «git push
$remote …», etc; but an easier way to test this would be to run
.
    compdef __git_describe_commit f
    f <TAB>
.
interactively.

> @@ -6493,8 +6493,9 @@ __git_commit_objects () {

This function completes hashes of commits, as output by `git log --pretty=%h`.
It's used by _git-send-email.  (I'm surprised that it isn't used by
_git-format-patch; those two commands are very similar.)

> @@ -6517,10 +6518,11 @@ __git_recent_commits () {

This is used by «git commit --fixup=<TAB>».

Cheers,

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author