git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 00/11] git worktree (re)move
@ 2016-11-12  2:23 Nguyễn Thái Ngọc Duy
  2016-11-12  2:23 ` [PATCH 01/11] copy.c: import copy_file() from busybox Nguyễn Thái Ngọc Duy
                   ` (12 more replies)
  0 siblings, 13 replies; 40+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-11-12  2:23 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

This is mostly a resend from last time [1]. The main difference is
patch 10/11 to prevent moving a worktree that contains submodules
because these .git files may need rewritten to point to the right
place. I'm leaving the rewriting .git files for future (preferably
done by "submodules guys").

[1] https://public-inbox.org/git/20160625075433.4608-1-pclouds@gmail.com/

Nguyễn Thái Ngọc Duy (11):
  copy.c: import copy_file() from busybox
  copy.c: delete unused code in copy_file()
  copy.c: convert bb_(p)error_msg to error(_errno)
  copy.c: style fix
  copy.c: convert copy_file() to copy_dir_recursively()
  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 ++-
 builtin/worktree.c                     | 179 ++++++++++++++++
 cache.h                                |   1 +
 contrib/completion/git-completion.bash |   5 +-
 copy.c                                 | 369 +++++++++++++++++++++++++++++++++
 t/t2028-worktree-move.sh               |  56 +++++
 worktree.c                             |  84 ++++++++
 worktree.h                             |  11 +
 8 files changed, 722 insertions(+), 11 deletions(-)

-- 
2.8.2.524.g6ff3d78


^ permalink raw reply	[flat|nested] 40+ messages in thread
* [PATCH 00/11] nd/worktree-move update
@ 2017-02-02  8:49 Nguyễn Thái Ngọc Duy
  2017-02-02  8:50 ` [PATCH 09/11] worktree move: accept destination as directory Nguyễn Thái Ngọc Duy
  0 siblings, 1 reply; 40+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2017-02-02  8:49 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

This squashes two changes from Johannes and Ramsay:

diff --git a/builtin/worktree.c b/builtin/worktree.c
index 339c622e20..a1c91f1542 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -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) {
diff --git a/t/t2028-worktree-move.sh b/t/t2028-worktree-move.sh
index 084acc6c6d..b3105eaaed 100755
--- a/t/t2028-worktree-move.sh
+++ b/t/t2028-worktree-move.sh
@@ -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(-)

-- 
2.11.0.157.gd943d85


^ permalink raw reply related	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2017-02-02  8:51 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-12  2:23 [PATCH 00/11] git worktree (re)move Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 01/11] copy.c: import copy_file() from busybox Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 02/11] copy.c: delete unused code in copy_file() Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 03/11] copy.c: convert bb_(p)error_msg to error(_errno) Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 04/11] copy.c: style fix Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 05/11] copy.c: convert copy_file() to copy_dir_recursively() Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 06/11] worktree.c: add validate_worktree() Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 07/11] worktree.c: add update_worktree_location() Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 08/11] worktree move: new command Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 09/11] worktree move: accept destination as directory Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 10/11] worktree move: refuse to move worktrees with submodules Nguyễn Thái Ngọc Duy
2016-11-12  2:23 ` [PATCH 11/11] worktree remove: new command Nguyễn Thái Ngọc Duy
     [not found] ` <xmqqeg2gyv1v.fsf@gitster.mtv.corp.google.com>
     [not found]   ` <xmqqa8d4yts7.fsf@gitster.mtv.corp.google.com>
2016-11-16 13:05     ` [PATCH 00/11] git worktree (re)move Duy Nguyen
2016-11-16 13:11       ` Duy Nguyen
2016-11-16 18:11       ` Junio C Hamano
2016-11-16 18:39         ` Junio C Hamano
2016-11-28  9:43 ` [PATCH v2 " Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 01/11] copy.c: import copy_file() from busybox Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 02/11] copy.c: delete unused code in copy_file() Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 03/11] copy.c: convert bb_(p)error_msg to error(_errno) Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 04/11] copy.c: style fix Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 05/11] copy.c: convert copy_file() to copy_dir_recursively() Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 06/11] worktree.c: add validate_worktree() Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 07/11] worktree.c: add update_worktree_location() Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 08/11] worktree move: new command Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 09/11] worktree move: accept destination as directory Nguyễn Thái Ngọc Duy
2016-11-28  9:43   ` [PATCH v2 10/11] worktree move: refuse to move worktrees with submodules Nguyễn Thái Ngọc Duy
2016-12-19 20:57     ` Stefan Beller
2016-11-28  9:43   ` [PATCH v2 11/11] worktree remove: new command Nguyễn Thái Ngọc Duy
2016-11-28 19:48   ` [PATCH v2 00/11] git worktree (re)move Junio C Hamano
2016-11-28 20:20     ` Junio C Hamano
2016-11-28 21:25       ` Johannes Sixt
2016-11-29 12:17         ` Duy Nguyen
2016-11-29 12:08       ` Duy Nguyen
2016-11-29 13:56         ` Duy Nguyen
2016-11-29 19:28           ` Junio C Hamano
2016-11-30  0:18             ` Stefan Beller
2016-11-29 21:14           ` Johannes Sixt
2016-11-30  0:09             ` Duy Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2017-02-02  8:49 [PATCH 00/11] nd/worktree-move update Nguyễn Thái Ngọc Duy
2017-02-02  8:50 ` [PATCH 09/11] worktree move: accept destination as directory Nguyễn Thái Ngọc Duy

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).