From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 000C51F852 for ; Tue, 1 Feb 2022 22:08:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237012AbiBAWHf (ORCPT ); Tue, 1 Feb 2022 17:07:35 -0500 Received: from bsmtp3.bon.at ([213.33.87.17]:63257 "EHLO bsmtp3.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbiBAWHf (ORCPT ); Tue, 1 Feb 2022 17:07:35 -0500 Received: from [192.168.0.98] (unknown [93.83.142.38]) by bsmtp3.bon.at (Postfix) with ESMTPSA id 4JpJvS0DLYz5tlP; Tue, 1 Feb 2022 23:07:31 +0100 (CET) Message-ID: Date: Tue, 1 Feb 2022 23:07:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH V3 1/2] patch-id: Fix antipatterns in tests Content-Language: en-US To: Jerry Zhang References: <20220131232529.8484-1-jerry@skydio.com> <20220131235218.27392-1-jerry@skydio.com> Cc: git@vger.kernel.org, gitster@pobox.com From: Johannes Sixt In-Reply-To: <20220131235218.27392-1-jerry@skydio.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 01.02.22 um 00:52 schrieb Jerry Zhang: > Clean up the tests for patch-id by moving file preparation > tasks inside the test body and redirecting files directly into > stdin instead of using 'cat'. You announce that `cat` is about to be removed... > test_expect_success 'patch-id handles no-nl-at-eof markers' ' > - cat nonl | calc_patch_id nonl && > - cat withnl | calc_patch_id withnl && > + cat >nonl <<-'EOF' && ... but it is still here... > + diff --git i/a w/a > + index e69de29..2e65efe 100644 > + --- i/a > + +++ w/a > + @@ -0,0 +1 @@ > + +a > + \ No newline at end of file > + diff --git i/b w/b > + index e69de29..6178079 100644 > + --- i/b > + +++ w/b > + @@ -0,0 +1 @@ > + +b > + 'EOF' > + cat >withnl <<-'EOF' && ... and here, although... > + diff --git i/a w/a > + index e69de29..7898192 100644 > + --- i/a > + +++ w/a > + @@ -0,0 +1 @@ > + +a > + diff --git i/b w/b > + index e69de29..6178079 100644 > + --- i/b > + +++ w/b > + @@ -0,0 +1 @@ > + +b > + 'EOF' > + calc_patch_id nonl + calc_patch_id withnl test_cmp patch-id_nonl patch-id_withnl > ' > test_done -- Hannes