Re: [PATCH] tcsh-completion re-using git-completion.bash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 16, 2012 at 10:46:16PM +0100, Felipe Contreras wrote:
> On Fri, Nov 16, 2012 at 10:22 PM, SZEDER Gábor <szeder@xxxxxxxxxx> wrote:
> > On Fri, Nov 16, 2012 at 10:03:41PM +0100, Felipe Contreras wrote:
> 
> >> > As I understand the main issues with using the completion script with
> >> > zsh are the various little incompatibilities between the two shells
> >> > and bugs in zsh's emulation of Bash's completion-related builtins.
> >> > Running the completion script under Bash and using its results in zsh
> >> > would solve these issues at the root.  And would allow as to remove
> >> > some if [[ -n ${ZSH_VERSION-} ]] code.
> >>
> >> We can remove that code already, because we now have code that is
> >> superior than zsh's bash completion emulation:
> >>
> >> http://article.gmane.org/gmane.comp.version-control.git/208173
> >
> > Which depends on the completion script having a wrapper function
> > around compgen filling COMPREPLY.
> 
> No, it does not. Previous incarnations didn't have this dependency:
> 
> http://article.gmane.org/gmane.comp.version-control.git/196720

Good.

> > However, COMPREPLY will be soon
> > filled by hand-rolled code to prevent expansion issues with compgen,
> > and there will be no such wrapper.
> 
> I'm still waiting to see a resemblance of that code, but my bet would
> be that there will be a way to fill both COMPREPLY, and call zsh's
> compadd. But it's hard to figure that out without any code. Which is
> why I'm thinking on doing it myself.
> 
> But even in that case, if push comes to shoves, this zsh wrapper can
> ultimately read COMPREPLY and figure things backwards, as even more
> previous versions did:
> 
> http://article.gmane.org/gmane.comp.version-control.git/189310

Even better.  I was just going to propose that zsh's completion could
just read the contents of COMPREPLY at the end of _git() and _gitk(),
because this way no zsh-induced helper functions and changes would be
needed to the completion script at all.

However, running the completion script with Bash would also prevent
possible issues caused by incompatibilities between the two shells
mentioned below.

> >> This is the equivalent of what Marc is doing, except that zsh has no
> >> problems running bash's code. Note there's a difference with zsh's
> >> emulation bash (or rather bourne shell, or k shell), and zsh's
> >> emulation of bash's _completion_. The former is fine, the later is
> >> not.
> >
> > There are a couple of constructs supported by Bash but not by zsh,
> > which we usually try to avoid.
> 
> Yes, and is that a big deal?

Not that big, but I wanted to point out that it's not "fine" either.
Just a slight maintenance burden, because we have to pay attention not
to use such constructs.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]