From: Eric Sunshine Date: Sun, 11 Oct 2020 06:34:42 GMT Subject: Re: [PATCH v2 1/1] worktree: teach `list` to annotate locked worktree Message-ID: In-Reply-To: On Sun, Oct 11, 2020 at 2:26 AM Eric Sunshine wrote: > Third, this is checking only that the first character following the > path component is a hex digit but then accepts _anything_ before > "locked". The regex can be tightened to allow only hex digits: > > grep "/locked *[0-9a-f][0-9a-f]* locked$" out && > ! grep "/unlocked *[0-9a-f][0-9a-f]* locked$" out Nevermind this last point. I see that there is other gunk after the hex string but before the `locked` annotation, so this suggestion breaks the test. The other two points -- (1) mandatory whitespace following the path component, and (2) anchoring the pattern -- would be welcome.