git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Sebastian Staudt <koraktor@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>,
	Duy Nguyen <pclouds@gmail.com>
Subject: Re: [PATCH v3 1/3] Add tests for describe with --work-tree
Date: Wed, 30 Jan 2019 07:43:32 -0500	[thread overview]
Message-ID: <20190130124331.GA2273@sigill.intra.peff.net> (raw)
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:

> > >> +    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.

> > > 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

      reply	other threads:[~2019-01-30 12:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  5:18 [PATCH v3 1/3] Add tests for describe with --work-tree Sebastian Staudt
2019-01-29  5:18 ` [PATCH v3 2/3] Setup working tree in describe Sebastian Staudt
2019-01-29 13:11   ` Jeff King
2019-01-29 17:39     ` Junio C Hamano
2019-01-29 20:53     ` Eric Sunshine
2019-01-29 22:35       ` Jeff King
2019-01-30 10:31         ` Sebastian Staudt
2019-01-30 12:44           ` Jeff King
2019-01-29  5:18 ` [PATCH v3 3/3] Add test for describe with a bare repository Sebastian Staudt
2019-01-29 13:12   ` Jeff King
2019-01-30 10:23     ` Sebastian Staudt
2019-01-29 13:00 ` [PATCH v3 1/3] Add tests for describe with --work-tree Jeff King
2019-01-29 17:47   ` Junio C Hamano
2019-01-30 10:23     ` Sebastian Staudt
2019-01-30 12:43       ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190130124331.GA2273@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=koraktor@gmail.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).