All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/20] "git worktree move" preview
@ 2016-02-03  9:35 Nguyễn Thái Ngọc Duy
  2016-02-03  9:35 ` [PATCH 01/20] usage.c: move format processing out of die_errno() Nguyễn Thái Ngọc Duy
                   ` (20 more replies)
  0 siblings, 21 replies; 50+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2016-02-03  9:35 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

This is the rough first cut of "git worktree move" for early
feedback. The series adds "git worktree move" which can

 - move a linked worktree to another place
 - move .git repository away

The first use case is obvious. The second less so.

Main worktree has always been an odd ball because it does not always
behave like a linked worktree. You can't move it (because you'll be
moving the repo along), you don't know where it is from 'worktree
list' because it's not tracked the same way. The move of .git dir will
automatically convert the main worktree to linked one, making it equal
to all other worktrees.

At the code level, it should be noted that I import copy_file() from
busybox for whole directory copy that preserves file permission and
stuff. Either that or I need to rely on POSIX command "cp" or "mv".
But that would make Windows adaptation harder later on.

A little off topic. The first two patches adds sys_error() that, like
die_errno(), automatically do strerror(). There's a 38 patches series
to convert error("...: %s", ..., strerror(errno)) to use it. I think
it's a good idea. So unless somebody objects, I'll post it some time
later.

Nguyễn Thái Ngọc Duy (20):
  usage.c: move format processing out of die_errno()
  usage.c: add sys_error() that prints strerror() automatically
  path.c: add git_common_path() and strbuf_git_common_path()
  path.c: add is_git_path_shared()
  copy.c: add copy_dir_recursively()
  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: recognize no main worktree
  worktree.c: add update_worktree_location()
  worktree.c: add update_worktree_gitfile()
  worktree.c: add collect_per_worktree_git_paths()
  worktree: avoid 0{40}, too many zeroes, hard to read
  worktree: simplify prefixing paths
  worktree: add "move" commmand
  worktree: refactor add_worktree()
  worktree: move repo, simple case
  worktree: move repo, convert main worktree

 builtin/worktree.c                | 297 ++++++++++++++++++++++++------
 cache.h                           |   6 +
 copy.c                            | 371 ++++++++++++++++++++++++++++++++++++++
 git-compat-util.h                 |   1 +
 path.c                            |  56 +++++-
 t/t2028-worktree-move.sh (new +x) |  77 ++++++++
 usage.c                           |  35 +++-
 worktree.c                        | 161 +++++++++++++++--
 worktree.h                        |  42 ++++-
 9 files changed, 963 insertions(+), 83 deletions(-)
 create mode 100755 t/t2028-worktree-move.sh

-- 
2.7.0.377.g4cd97dd

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

end of thread, other threads:[~2016-02-18  0:49 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03  9:35 [PATCH 00/20] "git worktree move" preview Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 01/20] usage.c: move format processing out of die_errno() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 02/20] usage.c: add sys_error() that prints strerror() automatically Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 03/20] path.c: add git_common_path() and strbuf_git_common_path() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 04/20] path.c: add is_git_path_shared() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 05/20] copy.c: add copy_dir_recursively() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 06/20] worktree.c: use is_dot_or_dotdot() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 07/20] worktree.c: store "id" instead of "git_dir" Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 08/20] worktree.c: add clear_worktree() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 09/20] worktree.c: add find_worktree_by_path() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 10/20] worktree.c: add is_main_worktree() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 11/20] worktree.c: recognize no main worktree Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 12/20] worktree.c: add update_worktree_location() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 13/20] worktree.c: add update_worktree_gitfile() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 14/20] worktree.c: add collect_per_worktree_git_paths() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 15/20] worktree: avoid 0{40}, too many zeroes, hard to read Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 16/20] worktree: simplify prefixing paths Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 17/20] worktree: add "move" commmand Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 18/20] worktree: refactor add_worktree() Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 19/20] worktree: move repo, simple case Nguyễn Thái Ngọc Duy
2016-02-03  9:35 ` [PATCH 20/20] worktree: move repo, convert main worktree Nguyễn Thái Ngọc Duy
2016-02-16 13:29 ` [PATCH v2 00/26] worktree lock, move, remove and unlock Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 01/26] usage.c: move format processing out of die_errno() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 02/26] usage.c: add sys_error() that prints strerror() automatically Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 03/26] copy.c: import copy_file() from busybox Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 04/26] copy.c: delete unused code in copy_file() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 05/26] copy.c: convert bb_(p)error_msg to (sys_)error Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 06/26] copy.c: style fix Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 07/26] copy.c: convert copy_file() to copy_dir_recursively() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 08/26] completion: support git-worktree Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 09/26] git-worktree.txt: keep subcommand listing in alphabetical order Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 10/26] wrapper.c: allow to create an empty file with write_file() Nguyễn Thái Ngọc Duy
2016-02-17 22:29     ` Junio C Hamano
2016-02-18  0:49       ` Duy Nguyen
2016-02-16 13:29   ` [PATCH v2 11/26] path.c: add git_common_path() and strbuf_git_common_path() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 12/26] worktree.c: use is_dot_or_dotdot() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 13/26] worktree.c: store "id" instead of "git_dir" Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 14/26] worktree.c: add clear_worktree() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 15/26] worktree.c: add find_worktree_by_path() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 16/26] worktree.c: add is_main_worktree() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 17/26] worktree.c: add validate_worktree() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 18/26] worktree.c: add update_worktree_location() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 19/26] worktree.c: add is_worktree_locked() Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 20/26] worktree: avoid 0{40}, too many zeroes, hard to read Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 21/26] worktree: simplify prefixing paths Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 22/26] worktree: add "lock" command Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 23/26] worktree: add "unlock" command Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 24/26] worktree: add "move" commmand Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 25/26] worktree move: accept destination as directory Nguyễn Thái Ngọc Duy
2016-02-16 13:29   ` [PATCH v2 26/26] worktree: add "remove" command Nguyễn Thái Ngọc Duy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.