From: Michael Rappazzo Date: Sun, 30 Aug 2015 19:10:39 GMT Subject: [PATCH v6 2/2] worktree: add 'list' command Message-ID: <1440961839-40575-3-git-send-email-rappazzo@gmail.com> In-Reply-To: <1440961839-40575-1-git-send-email-rappazzo@gmail.com> 'git worktree list' uses the for_each_worktree function to iterate, and outputs the worktree dir. With the verbose option set, it also shows the branch or revision currently checked out in that worktree. Signed-off-by: Michael Rappazzo --- Documentation/git-worktree.txt | 10 ++++- builtin/worktree.c | 42 +++++++++++++++++ t/t2027-worktree-list.sh | 100 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+), 2 deletions(-) create mode 100755 t/t2027-worktree-list.sh diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index fb68156..867a24a 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|--verbose] DESCRIPTION ----------- @@ -59,6 +60,10 @@ prune:: Prune working tree information in $GIT_DIR/worktrees. +list:: + +List the main worktree followed by all of the linked worktrees. + OPTIONS ------- @@ -88,11 +93,13 @@ OPTIONS -v:: --verbose:: - With `prune`, report all removals. + With `prune`, report all removals. + With `list` show the branch or revision currently checked out in that worktree. --expire