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]

 



Jacob Keller <jacob.keller@xxxxxxxxx> writes:

>> On the other hand, I am OK if "checkout -b", "switch -c" and
>> "--orphan" offered either:
>>
>>  (1) nothing, as your patch does, or
>>
>>  (2) all branches, except for the currently checked out one.
>
> Why reject the currently checked out one? If the premise is: "use a
> current branch to build a new branch name", I don't see a reason to
> restrict including the current branch here as well.

Yeah, "(3) all branches, without any exception" makes sense too.

>> It would be preferrable if they did the same thing.
>>
>> Thanks.

> The problem I see, is that regardless, I would like to see the following:
>
> git switch -c new-branch-name <SPACE><TAB>
>
> complete all references for the starting point.

Makes sense.  The starting point could be any branch or even a tag.

> 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.





[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