git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Alexander Grigoriev <alegrigoriev@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Bug: "git worktree add" Unable to checkout a branch with no local ref
Date: Tue, 28 Feb 2017 16:15:01 +0700	[thread overview]
Message-ID: <CACsJy8DQTi5s2BmHSkTTjVKZu+ToeVhywkZa2hzGtkzWo95LJw@mail.gmail.com> (raw)
In-Reply-To: <0E511C089BC341FBA9DC694C1CE770AE@daddy>

On Mon, Feb 27, 2017 at 9:22 PM, Alexander Grigoriev
<alegrigoriev@gmail.com> wrote:
> git version 2.10.2.windows.1:
> If a remote branch has never been checked out locally (its ref only exists
> in remotes/<remote>/ directory), "git worktree add" command is unable to
> check it out by its normal short name (not prefixed by remotes/<remote>),
> while "git checkout" command has been able to handle such a branch and
> properly convert it to a local branch.

We call that "dwim" (do what I mean). Unfortunately "git worktree add"
does not support it.

In the early prototype, "git worktree" called "git checkout"
underneath and something like that should have worked. But I don't
remember if the dwim came up when we decided not to let "git worktree"
run "git checkout". And since dwim thing is checkout thing, the
feature is gone from "git worktree add".

Anyway, I think patches are welcome.
-- 
Duy

      reply	other threads:[~2017-02-28  9:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 14:22 Bug: "git worktree add" Unable to checkout a branch with no local ref Alexander Grigoriev
2017-02-28  9:15 ` Duy Nguyen [this message]

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=CACsJy8DQTi5s2BmHSkTTjVKZu+ToeVhywkZa2hzGtkzWo95LJw@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=alegrigoriev@gmail.com \
    --cc=git@vger.kernel.org \
    /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).