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 11:10 AM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Jacob Keller <jacob.keller@xxxxxxxxx> writes:
>
> >> And that same "is this really helping?" reasoning applies equally to
> >> the "--orphan" option.
> >>
> >> I dunno.
> >>
> >
> > Fair enough, new branches based on previous branches makes sense.
>
> I actually do not have a strong opinion either way.  I just wanted
> to say that it would be good to make it consistent across "checkout
> -b", "switch -c" and "checkout/switch --orphan".
>
> It would be nice if "checkout -B" and "switch -C" pair offered
> existing branches, as the intention of using the capital letter is
> clear---the user wants to overwrite an existing one.
>
> 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.

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

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.

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