git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 1/3] Add tests for describe with --work-tree

From
Jeff King <peff@peff.net>
Date
Jan 30, 2019, 12:43 UTC
Message-ID
<20190130124331.GA2273@sigill.intra.peff.net>
In-Reply-To
<CA+xP2Sb1--LQJs+GXqKVE3FjNHujSn6Q-Ow=-LEHtRLcFJJMGA@mail.gmail.com>
On Wed, Jan 30, 2019 at 11:23:14AM +0100, Sebastian Staudt wrote:
Show 11 quoted lines
> > >> +    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.
> >
> 
> I guess I’ll use the even broader but apparently more portable A-*[0-9a-f]
> then. It’s used in the other checks, so this should be OK?

Yeah, that is OK, as long as you use it with `case` like check_describe does. Because it's a glob and not a regex, you do not have to worry about the anchoring issue.

Or if you mean to do an anchored but more general regex like:
  ^A-.*[0-9a-f]$
that is OK, too.
Show 8 quoted lines
> > > If that's indeed what we're checking, then an easier check is perhaps:
> > >
> > >   ! grep dirty ...
> >
> > Good.
> 
> This was copied and pasted from the existing check for describe with a
> clean working tree. So this should be changed, too.

I do think that makes what we're checking more obvious, so I wouldn't mind seeing the other tests converted to use this. But it may be hard if they are relying on check_describe().

I'm OK with anything that works and is robust. :)
-Peff
Previous: Sebastian Staudt
Message 15 of 15 in “Add tests for describe with --work-tree”
  1. 1/3 Add tests for describe with --work-treeSebastian Staudt, Jan 29, 2019
  2. 2/3 Setup working tree in describeSebastian Staudt, Jan 29, 2019
  3. Jeff KingJan 29, 2019
  4. Junio C HamanoJan 29, 2019
  5. Eric SunshineJan 29, 2019
  6. Jeff KingJan 29, 2019
  7. Sebastian StaudtJan 30, 2019
  8. Jeff KingJan 30, 2019
  9. 3/3 Add test for describe with a bare repositorySebastian Staudt, Jan 29, 2019
  10. Jeff KingJan 29, 2019
  11. Sebastian StaudtJan 30, 2019
  12. Jeff KingJan 29, 2019
  13. Junio C HamanoJan 29, 2019
  14. Sebastian StaudtJan 30, 2019
  15. Jeff KingJan 30, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.