worktree lock, move, remove and unlock
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest26 patches 2 repliesIn review
- v120 patches 0 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/26 | usage.c: move format processing out of die_errno()usage.c | +15 | 0 replies | |
| 2/26 | usage.c: add sys_error() that prints strerror() automaticallygit-compat-util.h usage.c | +11 | 0 replies | |
| 3/26 | copy.c: import copy_file() from busyboxcopy.c | +331 | 0 replies | |
| 4/26 | copy.c: delete unused code in copy_file()copy.c | +7 | 0 replies | |
| 5/26 | copy.c: convert bb_(p)error_msg to (sys_)errorcopy.c | +31 | 0 replies | |
| 6/26 | copy.c: style fixcopy.c | +29 | 0 replies | |
| 7/26 | copy.c: convert copy_file() to copy_dir_recursively()cache.h copy.c | +179 | 0 replies | |
| 8/26 | completion: support git-worktreecontrib/ | +23 | 0 replies | |
| 9/26 | git-worktree.txt: keep subcommand listing in alphabetical orderDocumentation/ builtin/ | +6 | 0 replies | |
| 10/26 | wrapper.c: allow to create an empty file with write_file()wrapper.c | +1 | 2 replies | |
| 11/26 | path.c: add git_common_path() and strbuf_git_common_path()cache.h path.c | +32 | 0 replies | |
| 12/26 | worktree.c: use is_dot_or_dotdot()builtin/ worktree.c | +3 | 0 replies | |
| 13/26 | worktree.c: store "id" instead of "git_dir"worktree.c worktree.h | +22 | 0 replies | |
| 14/26 | worktree.c: add clear_worktree()worktree.c worktree.h | +16 | 0 replies | |
| 15/26 | worktree.c: add find_worktree_by_path()worktree.c worktree.h | +22 | 0 replies | |
| 16/26 | worktree.c: add is_main_worktree()worktree.c worktree.h | +10 | 0 replies | |
| 17/26 | worktree.c: add validate_worktree()worktree.c worktree.h | +68 | 0 replies | |
| 18/26 | worktree.c: add update_worktree_location()worktree.c worktree.h | +31 | 0 replies | |
| 19/26 | worktree.c: add is_worktree_locked()worktree.c worktree.h | +24 | 0 replies | |
| 20/26 | worktree: avoid 0{40}, too many zeroes, hard to readbuiltin/ | +1 | 0 replies | |
| 21/26 | worktree: simplify prefixing pathsbuiltin/ | +3 | 0 replies | |
| 22/26 | worktree: add "lock" commandDocumentation/ builtin/ contrib/ +1 more | +89 | 0 replies | |
| 23/26 | worktree: add "unlock" commandDocumentation/ builtin/ contrib/ +1 more | +51 | 0 replies | |
| 24/26 | worktree: add "move" commmandDocumentation/ builtin/ contrib/ +1 more | +95 | 0 replies | |
| 25/26 | worktree move: accept destination as directorybuiltin/ | +18 | 0 replies | |
| 26/26 | worktree: add "remove" commandDocumentation/ builtin/ contrib/ +1 more | +124 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/26] worktree lock, move, remove and unlock
I think this is good enough to be further polished and maybe released. The series adds four new commands and bash completion for git-worktree.
Remaining work to do on git-worktree:
- "git worktree move --repository", in v1 but left out in v2 because it's trickier.
- .git/config issue and submodule support
A bit off topic, I've been using this script to add "cw" command, to chdir to another worktree with tab-completion. It works wonderfully, but I'm not sure if it can ever be merged to git-completion.bash.
-- 8< --
cw() {
cd "$(git worktree list --porcelain | grep -B2 refs/heads/$1 | head -n1 | cut -f 2 -d ' ')"
}_git_cw() {
local cur words cword prev
_get_comp_words_by_ref -n =: cur words cword prev
local list="$(git worktree list --porcelain | grep '^branch refs/heads/' | cut -c 19-)"
__gitcomp "$list"
}complete -o bashdefault -o default -o nospace -F _git_cw cw 2>/dev/null || \
complete -o default -o nospace -F _git_cw cw
-- 8< --
Nguyễn Thái Ngọc Duy (26):
usage.c: move format processing out of die_errno() usage.c: add sys_error() that prints strerror() automatically copy.c: import copy_file() from busybox
copy.c: delete unused code in copy_file()
copy.c: convert bb_(p)error_msg to (sys_)error copy.c: style fix
copy.c: convert copy_file() to copy_dir_recursively()
completion: support git-worktree
git-worktree.txt: keep subcommand listing in alphabetical order wrapper.c: allow to create an empty file with write_file() path.c: add git_common_path() and strbuf_git_common_path() worktree.c: use is_dot_or_dotdot()
worktree.c: store "id" instead of "git_dir" worktree.c: add clear_worktree()
worktree.c: add find_worktree_by_path()
worktree.c: add is_main_worktree()
worktree.c: add validate_worktree()
worktree.c: add update_worktree_location() worktree.c: add is_worktree_locked()
worktree: avoid 0{40}, too many zeroes, hard to read
worktree: simplify prefixing paths
worktree: add "lock" command
worktree: add "unlock" command
worktree: add "move" commmand
worktree move: accept destination as directory
worktree: add "remove" command
Documentation/git-worktree.txt | 55 +++-- builtin/worktree.c | 240 ++++++++++++++++++++- cache.h | 4 + contrib/completion/git-completion.bash | 29 +++ copy.c | 369 +++++++++++++++++++++++++++++++++ git-compat-util.h | 1 + path.c | 29 +++ t/t2028-worktree-move.sh (new +x) | 103 +++++++++ usage.c | 35 +++- worktree.c | 171 +++++++++++++-- worktree.h | 40 +++- wrapper.c | 2 +- 12 files changed, 1029 insertions(+), 49 deletions(-) create mode 100755 t/t2028-worktree-move.sh
Signature · 1 line
2.7.0.377.g4cd97dd