From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Jim Hill <gjthill@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Elijah Newren <newren@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: New orphan worktree?
Date: Wed, 06 Jan 2021 17:56:59 -0500 [thread overview]
Message-ID: <jwvk0spr8ta.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <CAEE75_1o+A13+8SBeF9S0SN0ZaYhgK3D1bhbfWNWZWsj9jOXrw@mail.gmail.com> (Jim Hill's message of "Wed, 6 Jan 2021 14:25:20 -0800")
>> not a good example to support the use of the "--orphan" option.
> I agree with that part, slathering infrastructure and abstractions on
> oneliners (okay, twoliners) is suspect in my book. worktree add,
> symoblic ref (really, no need to get lowlevel there, checkout --orphan
> does it) done. Tag an empty commit and the sequence gets closer
> to a legit oneliner
>
> git worktree add foo empty; git -C foo checkout --orphan newbranch
FWIW, I'd be quite happy to have an ad-hoc revision which represents
"the (currently non-existing) ancestor shared by all branches".
Assuming we'd call it "ORPHAN" (other names that come to mind would be
"ROOT", "GOD", "∅", "BIGBANG", ...), then
git checkout --orphan newbranch
would become
git checkout -b newbranch ORPHAN
and then I'd also be able to say
got worktree add -b newbranch foo ORPHAN
I've had occasional use for such a pseudo-revision in other
circumstances as well and I think I'd find it easier to remember how to
use this then the `--orphan` option.
Stefan
next prev parent reply other threads:[~2021-01-06 22:57 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvk0spr8ta.fsf-monnier+Inbox@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=gjthill@gmail.com \
--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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.