From: Junio C Hamano Date: Mon, 13 Jul 2015 21:02:18 +0000 (-0700) Subject: Merge branch 'es/worktree-add' X-Git-Tag: v2.5.0-rc2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97 Merge branch 'es/worktree-add' Update to the "linked checkout" in 2.5.0-rc1. Instead of "checkout --to" that does not do what "checkout" normally does, move the functionality to "git worktree add". * es/worktree-add: (24 commits) Revert "checkout: retire --ignore-other-worktrees in favor of --force" checkout: retire --ignore-other-worktrees in favor of --force worktree: add: auto-vivify new branch when is omitted worktree: add: make -b/-B default to HEAD when is omitted worktree: extract basename computation to new function checkout: require worktree unconditionally checkout: retire --to option tests: worktree: retrofit "checkout --to" tests for "worktree add" worktree: add -b/-B options worktree: add --detach option worktree: add --force option worktree: introduce "add" command checkout: drop 'checkout_opts' dependency from prepare_linked_checkout checkout: make --to unconditionally verbose checkout: prepare_linked_checkout: drop now-unused 'new' argument checkout: relocate --to's "no branch specified" check checkout: fix bug with --to and relative HEAD Documentation/git-worktree: add EXAMPLES section Documentation/git-worktree: add high-level 'lock' overview Documentation/git-worktree: split technical info from general description ... --- 799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97 diff --cc builtin/checkout.c index e227f64995,57545543eb..f71844a23a --- a/builtin/checkout.c +++ b/builtin/checkout.c @@@ -19,12 -19,10 +19,10 @@@ #include "ll-merge.h" #include "resolve-undo.h" #include "submodule.h" - #include "argv-array.h" - #include "sigchain.h" static const char * const checkout_usage[] = { - N_("git checkout [options] "), - N_("git checkout [options] [] -- ..."), + N_("git checkout [] "), + N_("git checkout [] [] -- ..."), NULL, }; @@@ -1364,9 -1197,7 +1222,7 @@@ int cmd_checkout(int argc, const char * OPT_BOOL(0, "ignore-skip-worktree-bits", &opts.ignore_skipworktree, N_("do not limit pathspecs to sparse entries only")), OPT_HIDDEN_BOOL(0, "guess", &dwim_new_local_branch, - N_("second guess 'git checkout no-such-branch'")), + N_("second guess 'git checkout '")), - OPT_FILENAME(0, "to", &opts.new_worktree, - N_("check a branch out in a separate working directory")), OPT_BOOL(0, "ignore-other-worktrees", &opts.ignore_other_worktrees, N_("do not check if another worktree is holding the given ref")), OPT_END(), diff --cc builtin/worktree.c index 2a729c661c,69248ba0a3..6a264ee749 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@@ -2,8 -2,12 +2,13 @@@ #include "builtin.h" #include "dir.h" #include "parse-options.h" + #include "argv-array.h" + #include "run-command.h" + #include "sigchain.h" ++#include "refs.h" static const char * const worktree_usage[] = { + N_("git worktree add [] "), N_("git worktree prune []"), NULL };