public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: git@vger•kernel.org
Cc: Eric Sunshine <sunshine@sunshineco•com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux•intel.com>
Subject: RFC "grep '...\{m,n\}"?
Date: Thu, 22 Jan 2015 12:19:19 -0800	[thread overview]
Message-ID: <xmqqvbjysh4o.fsf_-_@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1421927415-114643-1-git-send-email-kirill.shutemov@linux.intel.com> (Kirill A. Shutemov's message of "Thu, 22 Jan 2015 13:50:15 +0200")

"Kirill A. Shutemov" <kirill.shutemov@linux•intel.com> writes:

> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index 8197ed29a9ec..a31f7e0430e1 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '
>  	)
>  '
>  
> +test_expect_success 'respect core.abbrev' '
> +	git config core.abbrev 12 &&
> +	set_cat_todo_editor &&
> +	test_must_fail git rebase -i HEAD~4 >todo-list &&
> +	test 4 = $(grep -c "pick [0-9a-f]\{12,\}" todo-list)
> +'

Documentation/CodingGuidelines says

 - As to use of grep, stick to a subset of BRE (namely, no \{m,n\},
   [::], [==], or [..]) for portability.

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

   - We do not use -E;

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

but I see we have multiple hits from "git grep 'grep .*\\{'" (all in
the t/ directory).  I wonder

 - if everybody's system is now OK with \{m,n\} these days, or

 - there are people who are grateful that we stayed away from using
   \{m,n\} but they are not running the tests because their system
   is too exotic to pass other parts of the test suite.

If the former, we may want to drop the \{m,n\} from the forbidden
list.

  parent reply	other threads:[~2015-01-22 20:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 14:20 [PATCH] rebase -i: respect core.abbrev for real Kirill A. Shutemov
2015-01-19 22:43 ` Eric Sunshine
2015-01-20 10:42   ` [PATCHv2] " Kirill A. Shutemov
2015-01-22  6:56     ` Junio C Hamano
2015-01-22 11:50   ` [PATCHv3] " Kirill A. Shutemov
2015-01-22 20:10     ` Junio C Hamano
2015-01-22 20:19     ` Junio C Hamano [this message]
2015-01-23  0:39       ` RFC "grep '...\{m,n\}"? Duy Nguyen

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=xmqqvbjysh4o.fsf_-_@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=kirill.shutemov@linux$(echo .)intel.com \
    --cc=sunshine@sunshineco$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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