Minor missing features in worktree compare to new-workdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]