Re: changing the experimental 'git switch'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 21, 2021, 23:03 UTC
- Message-ID
- <xmqq7de6htfg.fsf@gitster.g>
- In-Reply-To
- <211021.86wnm6l1ip.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> | Switch with --merge | git switch -m branch | git switch --merge branch | > | Create | git switch -c new | git switch -n new | > | Create from existing | N/A | git switch -c new [<old>] |
I agree that adding a way to "clone", which is missing from "checkout/switch/branch", is a good idea. I do not necessarily think it is a good idea to say "-n" is "new" or "-c" is not "create" but is "clone/copy". As you said yourself in a later paragraph, "-n" sometimes is "--dry-run", and as we can see here "-c" in the context of a command that can create and clone (with two verbs behaving differently) is ambiguous.
Starting with a spelled out --copy vs --create without muddying the water with -n may be a sensible way forward.