From: Michael Rappazzo Date: Fri, 04 Sep 2015 21:39:29 GMT Subject: [PATCH v7 3/3] worktree: add 'list' command Message-ID: <1441402769-35897-4-git-send-email-rappazzo@gmail.com> In-Reply-To: <1441402769-35897-1-git-send-email-rappazzo@gmail.com> 'git worktree list' iterates through the worktree list, and outputs the worktree dir. By default, only the worktree path is output. Supported options include: --skip-bare: do not output bare worktrees --verbose: include the current head and ref (if applicable), also decorate bare worktrees Signed-off-by: Michael Rappazzo --- Documentation/git-worktree.txt | 10 +++- builtin/worktree.c | 63 +++++++++++++++++++++ t/t2027-worktree-list.sh | 122 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 194 insertions(+), 1 deletion(-) create mode 100755 t/t2027-worktree-list.sh diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index fb68156..b9339ed 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -11,6 +11,7 @@ SYNOPSIS [verse] 'git worktree add' [-f] [--detach] [-b ] [] 'git worktree prune' [-n] [-v] [--expire ] +'git worktree list' [-v] [--skip-bare] DESCRIPTION ----------- @@ -59,6 +60,10 @@ prune:: Prune working tree information in $GIT_DIR/worktrees. +list:: + +List the main worktree followed by each of the linked worktrees. + OPTIONS ------- @@ -89,10 +94,14 @@ OPTIONS -v:: --verbose:: With `prune`, report all removals. + With `list`, show more information about each worktree. This includes + if the worktree is bare, the revision currently checked out, and the + branch currently checked out (or 'detached HEAD' if none). --expire