From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Elijah Newren" <newren@gmail.com>,
"Stefan Monnier" <monnier@iro.umontreal.ca>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: New orphan worktree?
Date: Mon, 22 Feb 2021 19:33:38 -0500 [thread overview]
Message-ID: <CAPig+cQ5aLEzpUwFAkofd86HjJsJnJ-DtRKkrrkF0EdjHnJm4g@mail.gmail.com> (raw)
In-Reply-To: <xmqqmtvv64dp.fsf@gitster.g>
On Mon, Feb 22, 2021 at 6:59 PM Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
> > When I was pondering the issue before writing my original response,
> > two thoughts came to mind. (1) "git worktree add --force --orphan
> > <branch>" 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 <branch>" 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 <branch>`
as a way forward. Indeed, `git worktree add --force -b <branch>` 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`.
next prev parent reply other threads:[~2021-02-23 0:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 16:17 New orphan worktree? Stefan Monnier
2021-01-06 17:00 ` Jim Hill
2021-01-06 19:48 ` Elijah Newren
2021-01-06 20:33 ` Jim Hill
2021-01-06 19:40 ` Elijah Newren
2021-01-06 20:01 ` Eric Sunshine
2021-02-18 1:26 ` Ævar Arnfjörð Bjarmason
2021-02-21 19:55 ` Eric Sunshine
2021-02-22 9:44 ` Ævar Arnfjörð Bjarmason
2021-02-22 23:06 ` Eric Sunshine
2021-02-22 23:59 ` Junio C Hamano
2021-02-23 0:33 ` Eric Sunshine [this message]
2021-02-23 0:17 ` Ævar Arnfjörð Bjarmason
2021-02-23 0:55 ` Eric Sunshine
2021-02-23 11:06 ` Ævar Arnfjörð Bjarmason
2021-02-23 18:14 ` Junio C Hamano
2021-01-06 21:29 ` Junio C Hamano
2021-01-06 22:01 ` Jim Hill
2021-01-06 22:15 ` Junio C Hamano
2021-01-06 22:25 ` Jim Hill
2021-01-06 22:56 ` Stefan Monnier
2021-01-06 22:01 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cQ5aLEzpUwFAkofd86HjJsJnJ-DtRKkrrkF0EdjHnJm4g@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=monnier@iro.umontreal.ca \
--cc=newren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).