Re: [PATCH v2 1/1] worktree: teach `list` to annotate locked worktree
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Oct 11, 2020, 06:34 UTC
- Message-ID
- <CAPig+cQENxQ7nWwMOdd_Tw=LU=+d_r7n9rqAbjbYyCC7av+gHw@mail.gmail.com>
- In-Reply-To
- <CAPig+cTq5tz8m0bCJ3GtCa9yzOMNvd7j4fSJNwO9xjqkfK+YOg@mail.gmail.com>
On Sun, Oct 11, 2020 at 2:26 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 6 quoted lines
> 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.