From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Rappazzo Subject: [PATCH 2/2 v4] worktree: add 'list' command Date: Thu, 13 Aug 2015 14:32:19 -0400 Message-ID: <1439490739-9361-3-git-send-email-rappazzo@gmail.com> References: <1439490739-9361-1-git-send-email-rappazzo@gmail.com> Cc: git@vger.kernel.org, Michael Rappazzo To: gitster@pobox.com, sunshine@sunshineco.com X-From: git-owner@vger.kernel.org Thu Aug 13 20:33:03 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZPxJE-0002dE-Rj for gcvg-git-2@plane.gmane.org; Thu, 13 Aug 2015 20:33:01 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753235AbbHMScz (ORCPT ); Thu, 13 Aug 2015 14:32:55 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:36119 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753115AbbHMScy (ORCPT ); Thu, 13 Aug 2015 14:32:54 -0400 Received: by iodv127 with SMTP id v127so45478992iod.3 for ; Thu, 13 Aug 2015 11:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3HMXVQgwmPBuWhiOoQHF0evPj4K9o5WtXhTySF34sAg=; b=le/HN911AqquJLso3XvxH7zdAoCtbi/bCRh6TMg9H1CFTdwbOeMhiQeygjDDjFp7h9 KFug45+9U165fhCxEWx5nfbYBJs2dmUqOXSGUZdUIUS4xIqoNbSSx+hVrsyxT6yYiiDE FTDL7zVarLsnM5jgkWGyZ51bPV2R57ZCMldHqi0E3IwUWF1QJvUvo/A7OlEGu8Zeyepe bGYJ42EuikmPANCoNtJouARL61mNo7Z2I57u4UFCxp59UATx/0Q2tt2Ey/d//9ccLzVH UYii+ThMv3AtRd+6cxxrp99jXFDtRx8yxBEw37A89odwDyfe0UgUMHEVoye3qwxn4rrA cnkg== X-Received: by 10.107.150.145 with SMTP id y139mr37946916iod.128.1439490773582; Thu, 13 Aug 2015 11:32:53 -0700 (PDT) Received: from localhost.localdomain (114.sub-70-199-83.myvzw.com. [70.199.83.114]) by smtp.gmail.com with ESMTPSA id g12sm2038690ioe.28.2015.08.13.11.32.50 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Aug 2015 11:32:52 -0700 (PDT) X-Mailer: git-send-email 2.5.0 In-Reply-To: <1439490739-9361-1-git-send-email-rappazzo@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 'git worktree list' uses the for_each_worktree function to iterate, and outputs in the format: ' ()' Signed-off-by: Michael Rappazzo --- Documentation/git-worktree.txt | 11 ++++++++- builtin/worktree.c | 55 ++++++++++++++++++++++++++++++++++++++++++ t/t2027-worktree-list.sh | 51 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 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..e953b4e 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' [--path-only] DESCRIPTION ----------- @@ -59,6 +60,12 @@ prune:: Prune working tree information in $GIT_DIR/worktrees. +list:: + +List the main worktree followed by all of the linked worktrees. The default +format of the list includes the full path to the worktree and the branch or +revision that the head of that worktree is currently pointing to. + OPTIONS ------- @@ -93,6 +100,9 @@ OPTIONS --expire