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-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 6BE231F9FD for ; Tue, 23 Feb 2021 00:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230498AbhBWAeh (ORCPT ); Mon, 22 Feb 2021 19:34:37 -0500 Received: from mail-ed1-f44.google.com ([209.85.208.44]:37196 "EHLO mail-ed1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230125AbhBWAeg (ORCPT ); Mon, 22 Feb 2021 19:34:36 -0500 Received: by mail-ed1-f44.google.com with SMTP id h25so10468310eds.4 for ; Mon, 22 Feb 2021 16:34:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jcwoJvOuoSuxkD7a7EkI54R5Ph56izBKPKYky4R+hKM=; b=YWyu0EdQ9Kqe4svieGTCMftJRC9EUQfLuLhL/kwoMRdatBQJcPpj/Lid+1HRgInZEe +jMIdFBllLhcxfmDxfh6n8bZxt8hA8Yvjw5f2VmtS/WwellZUJTdVh+na0UQ9xqiTFRa sUPge4yHHEBo5HjBdtUbR7bYtx+cOGCKIZOp023YwvJC1DiC9qvoNap9XFy64DFqT1PD /+6b15UASYA+BfJJtTyzceyLJzbE14H/loiUhsWeVvebJfKlgdghp4U6pdRSOpr4cs0N K759sn6drbhvrmJJRLArLbzrx0AjBYixQdw88vNQG3NlfOOhMIUUv+EBCtVkY5bGZSiH 0T0Q== X-Gm-Message-State: AOAM531RfFHkPI6PP238TpfTZULNVBT4TBaTh/4XfcEv/1lW2QYGUFpK knE2YpID+7KNZqVwspBiSrtKpjYCVUU6I+/61EE= X-Google-Smtp-Source: ABdhPJw2bZLmb+1uMMWAgnzbu1vzXVmyRdvlHK8z5g37kByOhi8qlGlaoTG0m2dkBfKjtA1Ys9I5HAfcxSiwTteWOsM= X-Received: by 2002:aa7:c944:: with SMTP id h4mr25177826edt.233.1614040433252; Mon, 22 Feb 2021 16:33:53 -0800 (PST) MIME-Version: 1.0 References: <87wnv688u4.fsf@evledraar.gmail.com> <87ft1o8mi0.fsf@evledraar.gmail.com> In-Reply-To: From: Eric Sunshine Date: Mon, 22 Feb 2021 19:33:38 -0500 Message-ID: Subject: Re: New orphan worktree? To: Junio C Hamano Cc: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Elijah Newren , Stefan Monnier , Git Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Feb 22, 2021 at 6:59 PM Junio C Hamano wrote: > Eric Sunshine writes: > > When I was pondering the issue before writing my original response, > > two thoughts came to mind. (1) "git worktree add --force --orphan > > " would be one way to make your case work; (2) given how > > infrequently --orphan is used, we just punt and require people to > > first use "git branch -D " if necessary (which has been the > > status-quo for git-branch and git-switch). > > FWIW, as I personally view that branch -d/-D, checkout -b/-B, and > switch -c/-C were all mistakes (they should have been -d, -b and -c > with and without --force, respectively), I find the combination of > "--force --orphan" a reasonable way forward. I'm also leaning toward `git worktree add --force --orphan ` as a way forward. Indeed, `git worktree add --force -b ` is a sensible extension even without --orphan being part of the equation, and it's easy to frame -B in documentation as equivalent to `--force -b`.