Re: [PATCH 05/11] completion: add test showing subpar completion for git switch --orphan

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

 



On Tue, Apr 28, 2020 at 12:16 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Jacob Keller <jacob.keller@xxxxxxxxx> writes:
> > With this series, that's handled by just checking for "-c/-C" on the
> > command line and enabling all references. There's no positional checks
> > done, so every word can complete to a reference.
> >
> > I don't know offhand how to add completion which depends on the
> > position of the word we're completing, so I'd have to investigate how
> > to make that happen.
>
> I see.  Even though I say "(3) all branches" is a reasonable
> behaviour, too, if the starting point has to be more (i.e. including
> tags), that would not help the issue you have here.  It may not be
> too bad if we offered all refs (including tags, which may not be a
> good idea) in that case.  I dunno.
>
> Thanks.
>

Basically, when creating a branch, you often do "git switch -c
branch-name start-point"

branch-name would be the new branch name you want, and I think we
should complete local branches for this, but start-point can be any
reference, i.e. a tag, a local branch, or a remote reference.

I assumed completion would be most useful to complete the start-point,
and so I opted to lean towards fixing completion for -c/-C to complete
all references. However, I don't think the branch name should
necessarily complete from all references and it would make sense to
complete that portion only by local branch names.

I'm just not sure how best to implement that in our completion logic,
and I would rather ensure that start-point completes properly, if we
have to choose.

Thanks,
Jake



[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