Re: [PATCH] completion: fix __gitcomp_builtin no longer consider extra options

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

 



On Mon, Oct 22, 2018 at 5:51 AM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Nguyễn Thái Ngọc Duy  <pclouds@xxxxxxxxx> writes:
>
> > __gitcomp_builtin() has the main completion list provided by
> >
> >     git xxx --git-completion-helper
> >
> > but the caller can also add extra options that is not provided by
> > --git-completion-helper. The only call site that does this is "git
> > difftool" completion.
> >
> > This support is broken by b221b5ab9b (completion: collapse extra
> > --no-.. options - 2018-06-06), which adds a special value "--" to mark
> > that the rest of the options can be hidden by default. The commit
> > forgets the fact that extra options are appended after
> > "$(git xxx --git-completion-helper)", i.e. after this "--", and will
> > be incorrectly hidden as well.
> >
> > Prepend the extra options before "$(git xxx --git-completion-helper)"
> > to avoid this.
>
> Thanks for a clear analysis.  How did you find it?  Got annoyed that
> completion of difftool got broken, or discovered while trying to
> apply the same trick as difftool completion uses to another one and
> seeing that the technique does not work?

I was fixing format-patch completion and was surprised it did not work
as expected. Never really used difftool myself :P I only found out
about it when I asked myself "why wasn't this breakage found earlier?"
-- 
Duy




[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]

  Powered by Linux