Re: [PATCH v3 1/3] Add tests for describe with --work-tree
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 29, 2019, 17:47 UTC
- Message-ID
- <xmqqmunj8ifc.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190129130031.GA22211@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> The usual style is to put the whole snippet into single-quotes, and then > double-quote as appropriate within it. Like: > > test_expect_failure 'describe --dirty with --work-tree' ' > ( > cd "$TEST_DIRECTORY" && > git --git-dir "$TRASH_DIRECTORY/.git" ...etc > > Those variables will be expanded when test_expect_failure eval's the > snippet.
Good.
>> + grep 'A-\d\+-g[0-9a-f]\+' '$TRASH_DIRECTORY/out' > > Using "\d" isn't portable.
True, but not just \d. I think using \ before special characters to force an otherwise basic regular expression to be ERE (i.e. \+ at the end) is a GNUism.
Show 8 quoted lines
> This regex is pretty broad. What are we checking here? If I understand > the previous discussion, we just care that it doesn't have "dirty" in > it, right? I don't think this regex does that, because it doesn't anchor > the end of string. > > If that's indeed what we're checking, then an easier check is perhaps: > > ! grep dirty ...
Good.