git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
	Benoit Lecocq <benoit@openbsd.org>,
	kn@openbsd.org, Eric Sunshine <sunshine@sunshineco.com>,
	Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH v3 5/5] tests: fix and add lint for non-portable grep --file
Date: Fri, 24 Aug 2018 09:49:41 -0400	[thread overview]
Message-ID: <b1dc8c6a-1f42-b92f-8544-9593b6bd298f@gmail.com> (raw)
In-Reply-To: <xmqq6000izil.fsf@gitster-ct.c.googlers.com>

On 8/23/2018 4:44 PM, Junio C Hamano wrote:
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> The --file option to grep isn't in POSIX[1], but -f is[1]. Let's check
>> for that in the future, and fix the portability regression in
>> f237c8b6fe ("commit-graph: implement git-commit-graph write",
>> 2018-04-02) that broke e.g. AIX.
>>
>> 1. http://pubs.opengroup.org/onlinepubs/009695399/utilities/grep.html
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
> Thanks.

Yes, thanks! I'll keep this in mind for the future.

>>   t/check-non-portable-shell.pl | 1 +
>>   t/t5318-commit-graph.sh       | 2 +-
>>   2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
>> index 75f38298d7..b45bdac688 100755
>> --- a/t/check-non-portable-shell.pl
>> +++ b/t/check-non-portable-shell.pl
>> @@ -43,6 +43,7 @@ sub err {
>>   	/\bwc -l.*"\s*=/ and err '`"$(wc -l)"` is not portable (use test_line_count)';
>>   	/\bhead\s+-c\b/ and err 'head -c is not portable (use test_copy_bytes BYTES <file >out)';
>>   	/(?:\$\(seq|^\s*seq\b)/ and err 'seq is not portable (use test_seq)';
>> +	/\bgrep\b.*--file\b/ and err 'grep --file FILE is not portable (use grep -f FILE)';
>>   	/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (use FOO=bar && export FOO)';
>>   	/^\s*([A-Z0-9_]+=(\w+|(["']).*?\3)\s+)+(\w+)/ and exists($func{$4}) and
>>   		err '"FOO=bar shell_func" assignment extends beyond "shell_func"';
>> diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
>> index 3c1ffad491..0c500f7ca2 100755
>> --- a/t/t5318-commit-graph.sh
>> +++ b/t/t5318-commit-graph.sh
>> @@ -134,7 +134,7 @@ test_expect_success 'Add one more commit' '
>>   	git branch commits/8 &&
>>   	ls $objdir/pack | grep idx >existing-idx &&
>>   	git repack &&
>> -	ls $objdir/pack| grep idx | grep -v --file=existing-idx >new-idx
>> +	ls $objdir/pack| grep idx | grep -v -f existing-idx >new-idx
>>   '
>>   
>>   # Current graph structure:

  reply	other threads:[~2018-08-24 13:49 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23  9:14 [PATCH] tests: fix and add lint for non-portable head -c N Ævar Arnfjörð Bjarmason
2018-08-23  9:56 ` Test failures on OpenBSD Ævar Arnfjörð Bjarmason
2018-08-23 15:53   ` Junio C Hamano
2018-08-23 15:25 ` [PATCH v2 1/2] tests: fix and add lint for non-portable head -c N Ævar Arnfjörð Bjarmason
2018-08-23 16:11   ` Jeff King
2018-08-23 15:25 ` [PATCH v2 2/2] tests: fix and add lint for non-portable seq Ævar Arnfjörð Bjarmason
2018-08-23 16:08   ` Junio C Hamano
2018-08-23 17:20     ` Ævar Arnfjörð Bjarmason
2018-08-23 20:35   ` [PATCH v3 0/5] OpenBSD & AIX etc. portability fixes Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 1/5] tests: fix and add lint for non-portable head -c N Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 2/5] tests: fix and add lint for non-portable seq Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 3/5] tests: use shorter here-docs in chainlint.sed for AIX sed Ævar Arnfjörð Bjarmason
2018-08-23 20:42     ` Junio C Hamano
2018-08-23 20:56     ` Eric Sunshine
2018-08-24 15:20       ` [PATCH v4 0/6] OpenBSD & AIX etc. portability fixes Ævar Arnfjörð Bjarmason
2018-08-24 15:20       ` [PATCH v4 1/6] tests: fix and add lint for non-portable head -c N Ævar Arnfjörð Bjarmason
2018-08-24 15:20       ` [PATCH v4 2/6] tests: fix and add lint for non-portable seq Ævar Arnfjörð Bjarmason
2018-08-24 15:20       ` [PATCH v4 3/6] tests: fix comment syntax in chainlint.sed for AIX sed Ævar Arnfjörð Bjarmason
2018-08-24 20:52         ` Eric Sunshine
2018-08-24 15:20       ` [PATCH v4 4/6] tests: use shorter here-docs " Ævar Arnfjörð Bjarmason
2018-08-24 21:29         ` Eric Sunshine
2018-08-28 20:14           ` Ævar Arnfjörð Bjarmason
2018-08-28 20:17             ` Eric Sunshine
2018-08-27 19:36         ` Junio C Hamano
2018-09-04 22:36         ` What's cooking in git.git (Sep 2018, #01; Tue, 4) Junio C Hamano
2018-09-05  9:14           ` Eric Sunshine
2018-09-05 17:45             ` Junio C Hamano
2018-09-05 18:44             ` Eric Sunshine
2018-09-05  9:50           ` Eric Sunshine
2018-09-05 20:31             ` Jeff King
2018-09-05 21:56               ` Junio C Hamano
2018-09-05 13:38           ` jc/rebase-in-c-9-fixes, was " Johannes Schindelin
2018-09-05 16:41             ` Junio C Hamano
     [not found]           ` <xmqqbm9b6gxs.fsf@gitster-ct.c.googlers.com>
2018-09-05 16:48             ` Duy Nguyen
2018-09-05 18:18               ` SZEDER Gábor
2018-09-05  8:29         ` Ævar Arnfjörð Bjarmason
2018-09-05  8:59           ` Eric Sunshine
2018-09-05 11:07             ` Ævar Arnfjörð Bjarmason
2018-11-24 19:33               ` Ævar Arnfjörð Bjarmason
2018-11-25  4:28                 ` Torsten Bögershausen
2018-11-25  8:21                   ` Torsten Bögershausen
2018-11-25 14:14                     ` Ævar Arnfjörð Bjarmason
2018-09-05 16:45             ` Junio C Hamano
2018-08-24 15:20       ` [PATCH v4 5/6] tests: fix version-specific portability issue in Perl JSON Ævar Arnfjörð Bjarmason
2018-08-24 20:41         ` Eric Sunshine
2018-08-24 15:20       ` [PATCH v4 6/6] tests: fix and add lint for non-portable grep --file Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 4/5] tests: fix version-specific portability issue in Perl JSON Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 5/5] tests: fix and add lint for non-portable grep --file Ævar Arnfjörð Bjarmason
2018-08-23 20:44     ` Junio C Hamano
2018-08-24 13:49       ` Derrick Stolee [this message]
2018-08-23 15:42 ` [PATCH] tests: fix and add lint for non-portable head -c N Junio C Hamano
2018-08-23 17:24   ` Ævar Arnfjörð Bjarmason

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=b1dc8c6a-1f42-b92f-8544-9593b6bd298f@gmail.com \
    --to=stolee@gmail.com \
    --cc=avarab@gmail.com \
    --cc=benoit@openbsd.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=kn@openbsd.org \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).