git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Junio C Hamano <gitster@pobox.com>, Git List <git@vger.kernel.org>
Subject: Re: [RFC/PATCH] worktree: replace "checkout --to" with "worktree new"
Date: Fri, 3 Jul 2015 05:41:41 +0700	[thread overview]
Message-ID: <CACsJy8CwnWj80=4GGY4VnHnbxb_tL1Vg8S16rybmwGpgbSEexQ@mail.gmail.com> (raw)
In-Reply-To: <CAPig+cR1uLa7yiDn9EnTzfkDTOoToc6BTDRn5sYr12yPr6rXPg@mail.gmail.com>

On Fri, Jul 3, 2015 at 12:06 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> Unless we want to borrow fancy checkout options for "git worktree
>> add", we probably should just export checkout() function from clone.c
>> and use it instead of "git checkout". Much more lightweight and
>> simpler (it's one-way merge). Then we can revert checkout.c to the
>> version before "--to".
>
> Interesting idea, but doesn't this lose the ability to create a new
> branch ("worktree add foo -b bar") and other useful options like
> --track?

Those are what I call "fancy checkout options". I think we could start
simple with clone.c:checkout.c() and maybe libify switch_branches()
later on to gain --detach and stuff. There's another thing I missed,
when the new worktree is set up, HEAD contains a dummy value. It's
expected that the second checkout will update it with proper value (a
ref, detached HEAD....). So if you avoid running "git chckout" in
"worktree add" and use clone.c:checkout(), you have to re-do something
similar.
-- 
Duy

  reply	other threads:[~2015-07-02 22:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30  4:56 [RFC/PATCH] worktree: replace "checkout --to" with "worktree new" Eric Sunshine
2015-06-30  9:23 ` Duy Nguyen
2015-06-30 16:33   ` Junio C Hamano
2015-07-01 10:46     ` Duy Nguyen
2015-06-30 22:02   ` Eric Sunshine
2015-07-01  6:37     ` Eric Sunshine
2015-06-30 17:13 ` Junio C Hamano
2015-06-30 22:11 ` Eric Sunshine
2015-06-30 22:27   ` Junio C Hamano
2015-07-01  4:48     ` Mikael Magnusson
2015-06-30 22:32   ` Mark Levedahl
2015-07-01 16:53 ` Junio C Hamano
2015-07-01 17:13   ` Eric Sunshine
2015-07-01 17:16     ` Eric Sunshine
2015-07-01 17:32     ` Junio C Hamano
2015-07-01 18:18     ` Eric Sunshine
2015-07-01 18:52       ` Junio C Hamano
2015-07-02  1:07     ` Duy Nguyen
2015-07-02  2:52       ` Eric Sunshine
2015-07-02 12:41         ` Duy Nguyen
2015-07-02 12:50           ` Duy Nguyen
2015-07-02 17:06             ` Eric Sunshine
2015-07-02 22:41               ` Duy Nguyen [this message]
2015-07-02 16:59           ` Eric Sunshine
2015-07-02 18:45         ` Eric Sunshine
2015-07-02 19:00           ` Eric Sunshine
2015-07-02 19:19             ` Eric Sunshine

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='CACsJy8CwnWj80=4GGY4VnHnbxb_tL1Vg8S16rybmwGpgbSEexQ@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.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).