On Sun, Oct 11, 2020 at 6:12 AM Rafael Silva <rafaeloliveira.cs@xxxxxxxxx> wrote: > Teach "git worktree list" to append "locked" to its output. > > Signed-off-by: Rafael Silva <rafaeloliveira.cs@xxxxxxxxx> > --- > 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 <sunshine@xxxxxxxxxxxxxx>