From: Eric Sunshine Date: Mon, 12 Oct 2020 02:24:19 GMT Subject: Re: [PATCH v3] worktree: teach `list` to annotate locked worktree Message-ID: In-Reply-To: <20201011101152.5291-2-rafaeloliveira.cs@gmail.com> On Sun, Oct 11, 2020 at 6:12 AM Rafael Silva wrote: > Teach "git worktree list" to append "locked" to its output. > > Signed-off-by: Rafael Silva > --- > diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt > @@ -97,7 +97,8 @@ list:: > followed by each of the linked working trees. The output details include > whether the working tree is bare, the revision currently checked out, and the Nit: I'd probably drop the "and" just before the end of this line... > -branch currently checked out (or "detached HEAD" if none). > +branch currently checked out (or "detached HEAD" if none), and "locked" if > +the worktree is locked. ... which would leave just the one "and" here. However, this is minor and almost certainly not worth a re-roll. > +test_expect_success '"list" all worktress with locked annotation' ' > + test_when_finished "rm -rf locked unlocked out && git worktree prune" && > + git worktree add --detach locked master && > + git worktree add --detach unlocked master && > + git worktree lock locked && > + git worktree list >out && > + grep "/locked *[0-9a-f].* locked$" out && > + ! grep "/unlocked *[0-9a-f].* locked$" out > +' Looks good. With or without the minor suggested documentation tweak, consider this patch: Reviewed-by: Eric Sunshine