Skip to content

nd/worktree-move update

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11worktree.c: zero new 'struct worktree' on allocationworktree.c+2 -120 replies
2/11worktree: reorder an if statementbuiltin/worktree.c+3 -30 replies
3/11get_worktrees() must return main worktree as first item even on errorbuiltin/worktree.c t/t2027-worktree-list.sh worktree.c+28 -90 replies
4/11worktree.c: get_worktrees() takes a new flag argumentbranch.c builtin/branch.c builtin/worktree.c +2 more+8 -80 replies
5/11worktree list: keep the list sortedbuiltin/worktree.c t/t2027-worktree-list.sh worktree.c +1 more+36 -10 replies
6/11worktree.c: add validate_worktree()worktree.c worktree.h+68 -00 replies
7/11worktree.c: add update_worktree_location()worktree.c worktree.h+27 -00 replies
8/11worktree move: new commandDocumentation/git-worktree.txt builtin/worktree.c contrib/completion/git-completion.bash +1 more+81 -20 replies
9/11worktree move: accept destination as directorybuiltin/worktree.c+18 -10 replies
10/11worktree move: refuse to move worktrees with submodulesbuiltin/worktree.c+23 -00 replies
11/11worktree remove: new commandDocumentation/git-worktree.txt builtin/worktree.c contrib/completion/git-completion.bash +1 more+121 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11] nd/worktree-move update

This squashes two changes from Johannes and Ramsay:

builtin/worktree.c +1 -1
index 339c622e20..a1c91f1542 100644
@@ -528,7 +528,7 @@ static int unlock_worktree(int ac, const char **av, const char *prefix)
 
 static void validate_no_submodules(const struct worktree *wt)
 {
-	struct index_state istate = {0};
+	struct index_state istate = { NULL };
 	int i, found_submodules = 0;
 
 	if (read_index_from(&istate, worktree_git_path(wt, "index")) > 0) {
t/t2028-worktree-move.sh +4 -3
index 084acc6c6d..b3105eaaed 100755
@@ -71,13 +71,14 @@ test_expect_success 'move locked worktree' '
 '
 
 test_expect_success 'move worktree' '
+	toplevel="$(pwd)" &&
 	git worktree move source destination &&
 	test_path_is_missing source &&
 	git worktree list --porcelain | grep "^worktree" >actual &&
 	cat <<-EOF >expected &&
-	worktree $TRASH_DIRECTORY
-	worktree $TRASH_DIRECTORY/destination
-	worktree $TRASH_DIRECTORY/elsewhere
+	worktree $toplevel
+	worktree $toplevel/destination
+	worktree $toplevel/elsewhere
 	EOF
 	test_cmp expected actual &&
 	git -C destination log --format=%s >actual2 &&

Nguyễn Thái Ngọc Duy (11):
worktree.c: zero new 'struct worktree' on allocation
worktree: reorder an if statement
get_worktrees() must return main worktree as first item even on error worktree.c: get_worktrees() takes a new flag argument worktree list: keep the list sorted
worktree.c: add validate_worktree()
worktree.c: add update_worktree_location()
worktree move: new command
worktree move: accept destination as directory
worktree move: refuse to move worktrees with submodules worktree remove: new command

 Documentation/git-worktree.txt         |  28 ++++--
 branch.c                               |   2 +-
 builtin/branch.c                       |   2 +-
 builtin/worktree.c                     | 176 +++++++++++++++++++++++++++++++--
 contrib/completion/git-completion.bash |   5 +-
 t/t2027-worktree-list.sh               |  40 ++++++++
 t/t2028-worktree-move.sh               |  57 +++++++++++
 worktree.c                             | 126 +++++++++++++++++++----
 worktree.h                             |  15 ++-
 9 files changed, 410 insertions(+), 41 deletions(-)
Signature · 1 line
2.11.0.157.gd943d85