From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Sunshine Subject: Re: [PATCH v7 3/3] worktree: add 'list' command Date: Sun, 13 Sep 2015 00:25:29 -0400 Message-ID: References: <1441402769-35897-1-git-send-email-rappazzo@gmail.com> <1441402769-35897-4-git-send-email-rappazzo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Junio C Hamano , David Turner , Git List , karthik nayak To: Michael Rappazzo X-From: git-owner@vger.kernel.org Sun Sep 13 06:25: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 1ZayrV-00008H-6P for gcvg-git-2@plane.gmane.org; Sun, 13 Sep 2015 06:25:57 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750794AbbIMEZb (ORCPT ); Sun, 13 Sep 2015 00:25:31 -0400 Received: from mail-yk0-f178.google.com ([209.85.160.178]:36677 "EHLO mail-yk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbbIMEZa (ORCPT ); Sun, 13 Sep 2015 00:25:30 -0400 Received: by ykdt18 with SMTP id t18so105995721ykd.3 for ; Sat, 12 Sep 2015 21:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=C0B51dUkkeju5sbXCB2ft8gKTPOUq1MyluI6o16c9U4=; b=Drk9vVigWBjkY9lPujA4nXmqxoP+7cRInwRne8FYfs+KEU21yb9+m+enjG9eRZ/M1q HRagnhxcXeio0NKAX3+9nNIiJCjUgyApMstVDwBjszbA1YeSTvLQK1sTK4qHrb5breww jdsfyocxi2aprCgN3ykPpafR6a8yEukiyuhUcZcna3DLJO/kYh29boWA2+A8zcrM+g9+ sV3iBPKKiKnkHcexM0gO+SbixxsWW0fno/jwp2neNdGODXbPlAIP8t/K4PaN2h5e5pGV UWa0Fy3UsUYddVt6QENnQbzCvhDYUPcH9/CrJFPKcV3uXnLgPoUh3AmKiTir1SfsdCpp wZsg== X-Received: by 10.170.158.10 with SMTP id z10mr6884657ykc.71.1442118329312; Sat, 12 Sep 2015 21:25:29 -0700 (PDT) Received: by 10.37.36.145 with HTTP; Sat, 12 Sep 2015 21:25:29 -0700 (PDT) In-Reply-To: <1441402769-35897-4-git-send-email-rappazzo@gmail.com> X-Google-Sender-Auth: vR7chGy872Th4eLuEkBtQRrWdHk Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Fri, Sep 4, 2015 at 5:39 PM, Michael Rappazzo wrote: > 'git worktree list' iterates through the worktree list, and outputs > the worktree dir. By default, only the worktree path is output. Comments below in addition to Junio's... > Supported options include: > --skip-bare: do not output bare worktrees > --verbose: include the current head and ref (if applicable), also > decorate bare worktrees I don't care strongly at this point, but an alternate, (possibly) more reviewer-friendly, approach would be to split this into several patches: the first would add a bare-bones "list" command, and each subsequent patch would flesh it out by introducing one option and/or enhancing the output in some way. > Signed-off-by: Michael Rappazzo > --- > 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] I'm somewhat skeptical of the --skip-bare option. Recalling my v2 review[1] skepticism of the --main-only option: The more options we have, the more we have to document, test, and support... Thus, I wonder how much value this option has. Presumably, for scripters, we will want to have a --porcelain option, the output of which will contain useful information about a worktree, including whether it's bare, and a script can, on its own, easily filter out a bare worktree if desired. [1]: http://article.gmane.org/gmane.comp.version-control.git/275528 > 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). Hmm, this prints both the SHA1 and the branch name (or literal string "detached HEAD")? Is that a good use of screen real-estate? In particular, I'm wondering how useful the SHA1 is to the user when not detached. I would expect (perhaps wrongly) that it would be sufficient to output either the branch name *or* the SHA1 (which implies "detached" without having to say so literally). > --expire