From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-5.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id E90311F670 for ; Sun, 24 Oct 2021 06:54:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229861AbhJXG4i (ORCPT ); Sun, 24 Oct 2021 02:56:38 -0400 Received: from smtprelay06.ispgateway.de ([80.67.18.29]:36354 "EHLO smtprelay06.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbhJXG4h (ORCPT ); Sun, 24 Oct 2021 02:56:37 -0400 Received: from [79.233.232.241] (helo=[192.168.2.202]) by smtprelay06.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1meXOJ-00029D-MM for git@vger.kernel.org; Sun, 24 Oct 2021 08:53:59 +0200 Message-ID: Date: Sun, 24 Oct 2021 08:54:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 From: Martin Subject: Re: changing the experimental 'git switch' (was: [Summit topic] Improving Git UX) Cc: git@vger.kernel.org References: <211021.86wnm6l1ip.gmgdl@evledraar.gmail.com> <9c6b3041-a5c0-6fe1-860e-7bfcb292ae81@mfriebe.de> Content-Language: en-GB In-Reply-To: <9c6b3041-a5c0-6fe1-860e-7bfcb292ae81@mfriebe.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Df-Sender: bWVAbWZyaWViZS5kZQ== To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 22/10/2021 16:04, martin wrote: > Unless there is more, than the copying of the reflog, wouldn't it be > better to add an option "--copy-reflog" Ok, I found the answer (actually 2 / see other mail) > The |-c| and |-C| options have the exact same semantics as |-m| and > |-M|, except instead of the branch being renamed, it will be copied to > a new name, along with its config and reflog. As for the "config" being part depends on which part of the man-page one reads. But, anyway on the topic of "git switch" Copying a branch (and maybe moving too) could be seen as an extension to creating a new one. After all, after the copy operation there is a newly created branch. Only it has some more data with it. So one could do git switch  --settings-from --create    git switch  -s    -c    "settings-from" is just an example, there may be better names for it. Ideally not starting with a "c". And using a name different from "copy" may be more accurate, because unless it is created on the same one to which the points, then its at best partially copied. On top of that options could be brought in, to copy only reflog or only config. Using the above with an --force-create / -C would make it a "move branch". In this case there could be a shortcut, if and (the old)   are the same.