git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yichao Yu <yyc1992@gmail.com>
To: git <git@vger.kernel.org>
Subject: Minor missing features in worktree compare to new-workdir
Date: Wed, 14 Jun 2017 08:31:11 -0400	[thread overview]
Message-ID: <CAMvDr+Qxjdgnm0aW3WenDpFs2NBhyrNXZA2M7sjsCjJs+RzM3Q@mail.gmail.com> (raw)

Hi,

I've just learnt recently that the new-workdir script has finally got
a builtin version, i.e. worktree. I've given it a short try and for
the most part it works as good or better than new-workdir.

However, there's few minor features that I use in new-workdir that
doesn't seem to be supported by worktree.

1. the branch name in new-workdir has the same behavior as checkout,
i.e. when it matches a remote branch name a local branch tracking that
remote branch will be created and checked out. worktree gives an error
in this case. This is very useful for fetching someone else' feature
branch into a different work dir for testing.

2. worktree doesn't seem to support multiple worktree on the same
branch. I do this for testing different options and also to checkout a
base branch on a worktree before deleting the dev branch checked out
in the workdir. This will indeed cause one of the checkout to be dirty
when the branch is updated somewhere else but it doesn't seem to cause
much issue otherwise. (this mainly happen when I forgot to remove a
workdir so the solution is usually just remove that out-of-date
checkout).

3. There's an error when the branch name is omitted but the default
brach name already exist. Can it default to checking out the branch if
it already exist instead? (The behavior of creating new branch is of
course also useful when the branch doesn't exist)

4. worktree doesn't seem to be runable outside a git repo. new-workdir
can. This is pretty minor and mainly useful when checking out a branch
that matches the nested structure in the branch name (i.e. I'd like to
checkout branch A/B/C into A/B/C/ while master branch is in master/. I
usually first cd to A/B before running git new-workdir ../../master C)
This only saves a little typing in certain cases so it's a very minor
issue.....

All tests are done 2.13.1 from ArchLinux official repo.

Thanks.

Yichao Yu

             reply	other threads:[~2017-06-14 12:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 12:31 Yichao Yu [this message]
2017-06-14 12:41 ` Minor missing features in worktree compare to new-workdir Paul Smith
2017-06-15  0:40   ` Yichao Yu

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=CAMvDr+Qxjdgnm0aW3WenDpFs2NBhyrNXZA2M7sjsCjJs+RzM3Q@mail.gmail.com \
    --to=yyc1992@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.
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 NNTP newsgroup(s).