v3 changes almost all patches so I didn't bother with interdiff
[1/6] worktree.c: add find_worktree()
This replaces the old find_wortree_by_path(). It now takes both prefix
and command line argument so it can do some intelligent things with
them if needed. [2/6] worktree.c: find_worktree() learns to identify worktrees by basename
This is from Eric's suggestion. Here we only care about the "argument"
argument and ignore the "prefix" argument from 1/6 [3/6] worktree.c: add is_main_worktree()
This is the only unchanged patch since v2! [4/6] worktree.c: retrieve lock status (and optionally reason) in get_worktrees()
This used to be is_worktree_locked()
[5/6] worktree: add "lock" command
Besides Eric's comments in v2, the syntax line "worktree lock <path>"
is changed to "worktree lock <worktree>", where <worktree> could be
either a path, or a base name, or something more in future. I'm aware
that we don't like showing "worktrees" in user documents, favoring
working trees. But I think <worktree> is ok in this case. [6/6] worktree: add "unlock" command
Pretty much addressing comments from v2 and some more changes because
of the new 1/6 and 4/6. Documentation/git-worktree.txt | 33 +++++++++++++----
builtin/worktree.c | 66 ++++++++++++++++++++++++++++++++++
contrib/completion/git-completion.bash | 5 ++-
t/t2028-worktree-move.sh (new +x) | 62 ++++++++++++++++++++++++++++++++
worktree.c | 53 +++++++++++++++++++++++++++
worktree.h | 14 ++++++++
6 files changed, 226 insertions(+), 7 deletions(-)
create mode 100755 t/t2028-worktree-move.sh