From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Rappazzo Subject: [PATCH v7 3/3] worktree: add 'list' command Date: Fri, 4 Sep 2015 17:39:29 -0400 Message-ID: <1441402769-35897-4-git-send-email-rappazzo@gmail.com> References: <1441402769-35897-1-git-send-email-rappazzo@gmail.com> Cc: git@vger.kernel.org, Michael Rappazzo To: gitster@pobox.com, sunshine@sunshineco.com, dturner@twopensource.com X-From: git-owner@vger.kernel.org Fri Sep 04 23:39:58 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 1ZXyi6-0000FJ-PB for gcvg-git-2@plane.gmane.org; Fri, 04 Sep 2015 23:39:51 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933933AbbIDVjr (ORCPT ); Fri, 4 Sep 2015 17:39:47 -0400 Received: from mail-ig0-f169.google.com ([209.85.213.169]:35898 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933918AbbIDVjp (ORCPT ); Fri, 4 Sep 2015 17:39:45 -0400 Received: by igcrk20 with SMTP id rk20so21713936igc.1 for ; Fri, 04 Sep 2015 14:39:45 -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=ooOxjK8NZAfx/ss9VDsR50r11u6ma2VFYyA4soGi8Rg=; b=PryuwRThRMFLG9DLcZm7G4i+fK2Cb56Aqs9u6UpBwkCB4hrlPdboEtwgNp7UKwFkoa cBaLHT3qzaN8q8MaLddKiDv2kDHiakuXKhqaP3v4JQ3lDE9w8HMxJRpB/orICoelhpB7 hhUTSaUPbe7afjlDD6BqfcrJvIrzwETKODTaQ903dORUKyjoO06h23U9IxoINWYQFhTk qQDbABJosn9OKi3ZKstVuzQqN8wkVVcJ6mhef+/MPiByl+Owd4gK/c4JhLnU3+DuYn12 +0sK6ouALIw4mCessCDt3MWLWRRNr6secw1uUmoM4w9nbJ7W8FR/y5pq8v68UJBLSxfp 9mRg== X-Received: by 10.50.138.69 with SMTP id qo5mr10715308igb.33.1441402784858; Fri, 04 Sep 2015 14:39:44 -0700 (PDT) Received: from localhost.localdomain (155.sub-70-208-71.myvzw.com. [70.208.71.155]) by smtp.gmail.com with ESMTPSA id vk8sm2325936igb.4.2015.09.04.14.39.43 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Sep 2015 14:39:44 -0700 (PDT) X-Mailer: git-send-email 2.5.0 In-Reply-To: <1441402769-35897-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' 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