git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dmitry Potapov <dpotapov@gmail.com>
Cc: git@vger.kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] git-filter-branch could be confused by similar names
Date: Fri, 04 Jan 2008 17:17:39 -0800	[thread overview]
Message-ID: <7v4pdtgjf0.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080104155114.GS3373@dpotapov.dyndns.org> (Dmitry Potapov's message of "Fri, 4 Jan 2008 18:51:15 +0300")

Dmitry Potapov <dpotapov@gmail.com> writes:

> On Thu, Jan 03, 2008 at 01:27:27PM -0800, Junio C Hamano wrote:
>> ... I had an
>> impression that we try to stick to a subset of BRE (namely, no
>> \{m,n\}, [::], [==], nor [..]).
>
> I was not aware about this policy, and I am not aware about
> existing any grep that does not grok the expressions I used
> above. So, I thought they are commonly accepted, but I might
> be wrong.

Well I might be wrong too, as I did not vet all the existing use
of grep in our code.  That's why I said I had "an impression".

Now I have ("git grep 'grep ' -- 'git-*.sh'"), and it seems to
be that we do stick to a narrow subset of BRE.

 * We do not use \{m,n\};

 * We do not use -E;

 * We do not use ? nor + (which are \{0,1\} and \{1,\}
   respectively in BRE) but that goes without saying as these
   are ERE elements not BRE (note that \? and \+ you wrote are
   not even part of BRE -- making them accessible from BRE is a
   GNU extension).

IOW, our scripts' use of grep is very 80'sh ;-)

I do not mind using things that are available in POSIX BRE, but
let's not rely on GNU extension that may cause issues to other
people.

Other things I noticed while looking at "t/*.sh":

 * t/t3600-rm.sh and t/5401-update-hooks.sh have unnecessary
   uses of egrep that can instead be grep;

 * t/t3800-mktag.sh uses egrep but I think it can be grep; also,
   I think the use of temporary file expect.pat is unnecessary.

 * t/t5510-fetch.sh does use '^[0-9a-f]\{40\} '.

 * t/t7001-mv.sh uses -E only to use '.+' when it can just as
   easily say '..*' instead.

 * t/t7600-merge.sh has two occurrences of (GNU extended) " \+"
   that should be "  *" for portability.  An alternative is to
   use grep -E and say " +" instead, but then the other plus
   sign on the same line needs to be quoted.

Other than the one in 5510 I consider them log hanging fruits
for janitors.

      parent reply	other threads:[~2008-01-05  2:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-25 14:35 [PATCH] git-filter-branch could be confused by similar names Dmitry Potapov
2007-12-29 22:36 ` Johannes Schindelin
2007-12-30 10:31   ` Dmitry Potapov
2007-12-30 10:46     ` Johannes Schindelin
2007-12-30 13:54       ` Dmitry Potapov
2007-12-30 16:03         ` Johannes Schindelin
2007-12-30 18:40           ` Dmitry Potapov
2007-12-30 18:51           ` Dmitry Potapov
2008-01-03 21:27             ` Junio C Hamano
2008-01-04 15:51               ` Dmitry Potapov
2008-01-04 20:28                 ` Junio C Hamano
2008-01-05 16:03                   ` Johannes Schindelin
2008-01-05 20:23                     ` [PATCH 1/2] git-rev-parse --symbolic-full-name Junio C Hamano
2008-01-05 20:28                     ` [PATCH 2/2] filter-branch: work correctly with ambiguous refnames Junio C Hamano
2008-01-06  1:57                       ` Johannes Schindelin
2008-01-06  2:53                         ` Junio C Hamano
2008-01-06  9:14                           ` Johannes Schindelin
2008-01-05  1:17                 ` Junio C Hamano [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=7v4pdtgjf0.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    /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).