From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.9 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C357320193 for ; Thu, 11 Aug 2016 18:58:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751550AbcHKS6Y (ORCPT ); Thu, 11 Aug 2016 14:58:24 -0400 Received: from mout.web.de ([212.227.17.11]:62610 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbcHKS6X (ORCPT ); Thu, 11 Aug 2016 14:58:23 -0400 Received: from localhost ([195.252.60.88]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MDxCN-1bR5pp3i6p-00HO8R; Thu, 11 Aug 2016 20:58:15 +0200 Date: Thu, 11 Aug 2016 18:58:12 +0000 From: Torsten =?iso-8859-1?Q?B=F6gershausen?= To: Johannes Schindelin Cc: Jeff King , git@vger.kernel.org Subject: Re: t0027 racy? Message-ID: <20160811185812.GA18434@tb-raspi> References: <20160808152926.mciovipy5qlnqegs@sigill.intra.peff.net> <20160808203224.GA28431@tb-raspi> <20160809065110.GB17777@peff.net> <20160809113337.GA1143@tb-raspi> <20160809114938.pcrvirrzrh6ldmnr@sigill.intra.peff.net> <20160809125958.GA1501@tb-raspi> <20160809132744.kjzmkgt2qiugeolj@sigill.intra.peff.net> <20160809212802.GA4132@tb-raspi> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:hIGfdEv32pbbCTHDmiNxDClv1NkROkmAXzeN8RUNlVVfW8d3GlY n9Mj75J1TIM6y/OB5pOAZzS4R1jW2NZgiDguxUuzzq3xQ9FdhixCN5f7OQdT4JXMP3+O7Gp Bc9ao7tt61I9S24Rud4JpQf1OVw07G7yHMvlv7paSIT0G+jz9UGgq5fhymPA+GN8MZCAMWV QcoZBAN5VItZM3UQMLGNQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:072uuwldR9w=:MAchFwOVURmTRmvjIGFXX3 p3uRILdSjXNTPdSM2B7e/yLDmB770YDx3HezuYYdB41Z0ceQi2aspQ1Ob127HPfE3bM90QtAn /8G4evYUT5YyvdkjOBz6cRWXg7GwnbS9Hx2W2AlkYyYO+0jbK74373CAJWp+3ovGTSAtsnif5 PcbttQuk+MdLUdmbI41lVqdkarIBhvjE+JvnhnHD6R+sK5kW6jnBJp/XHw9Mbf1wUdQxzXoiy 4bSgAW3TMc2cyNnXpF8ksdfblXlvjFSHZjl+LqZJ0jbQrXfQ9awFdy7IMmbEe163U2kQFw8Um rIBsI/obUS6Ak/urOt1Rm6W1WNYXyZcLWqucKddDv6i/qpctegKH8LdBrKsENe4KgGj1FsA3/ ikP3JvtWoXyDYRhOOl4ejYsxd3sXAbxgD1GkKKY+gATAjOFtMuESm+jBeknRSALMAfc3duJ9W lfCxHAV+B1q22/0B8gM4bE5aCF7NSieC2lWXS7RpTcbpxAGSQkzbD7fQBUETkvtt694XyW6RW VYys2cvfjhthFqP8k7fcPwGPZFmkYXzV6I2Nf04ZVkc3cShjaHeFSO4jAtbLpGPzDRSLfGDkc Hc2OWCrfdP6EwWJNT7ofL8hGCYwFtSSOVZ8iFfsK24rP8hukpTe+X7apPhhAQrbJ8oOaiMgH2 NwKwhYlZzALEvswcWhXsggMCVRnztKbRF5mD0ums/z8uDNDZ7oXczblPRQyu5tWraSHG5lH92 UTbICTZt1hLtjzi2Fgdt9lAQ4AjL8pagkO12YgFSBvY3LiqqPJOjWa49rSM= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org [] > FWIW I would strongly prefer to use the warning of `git add` and not even > bother with `git commit`. What we are interested in is the warning > message, generated by convert_to_git(). The commit is needed, because we check the content of the commit later. > Not using the first one and [] > > On that matter, I wonder whether there would be a chance to revamp t0027 > in a major way, with the following goals: > > - to make it very obvious to the casual reader what is being tested > > - to combine Git invocations when possible, e.g. running one big `git add` > on a couple of files and then verify the relevant parts of the output > > - dramatically decreasing the time required to run the test, without > sacrificing correctness (I would wager a bet that not only a few of > those 1388 test cases essentially exercise identical code paths) Good ideas, I will work on a series that fixes bugs first, and then we can see if there is room for optimization. What do you think about this as a starting point, more things will follow. I like to here comments about the commit msg first ;-) commit 3754404d3d1ea4a0cbbed4986cc4ac1b5fe6b66e Author: Torsten Bögershausen Date: Thu Aug 11 18:47:29 2016 +0200 t0027: Correct raciness in NNO test When a non-reversible CRLF conversion is done in "git add", a warning is printed on stderr. The commit_chk_wrnNNO() function in t0027 was written to test this, but did the wrong thing: Instead of looking at the warning from "git add", it looked at the warning from "git commit". Correct this and replace the commit for each and every file with a commit of all files in one go. The function commit_chk_wrnNNO() will to be renamed in a separate commit. Thanks to Jeff King for analizing t0027. Reporyed-By: Johannes Schindelin diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh index 2860d2d..6e44382 100755 --- a/t/t0027-auto-crlf.sh +++ b/t/t0027-auto-crlf.sh @@ -119,8 +119,7 @@ commit_chk_wrnNNO () { fname=${pfx}_$f.txt && cp $f $fname && printf Z >>"$fname" && - git -c core.autocrlf=$crlf add $fname 2>/dev/null && - git -c core.autocrlf=$crlf commit -m "commit_$fname" $fname >"${pfx}_$f.err" 2>&1 + git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err" done test_expect_success "commit NNO files crlf=$crlf attr=$attr LF" ' @@ -394,11 +393,10 @@ test_expect_success 'commit files attr=crlf' ' # attr LF CRLF CRLFmixLF LF_mix_CR CRLFNUL commit_chk_wrnNNO "" "" false "" "" "" "" "" -commit_chk_wrnNNO "" "" true LF_CRLF "" "" "" "" +commit_chk_wrnNNO "" "" true "" "" "" "" "" commit_chk_wrnNNO "" "" input "" "" "" "" "" - -commit_chk_wrnNNO "auto" "" false "$WILC" "" "" "" "" -commit_chk_wrnNNO "auto" "" true LF_CRLF "" "" "" "" +commit_chk_wrnNNO "auto" "" false "" "" "" "" "" +commit_chk_wrnNNO "auto" "" true "" "" "" "" "" commit_chk_wrnNNO "auto" "" input "" "" "" "" "" for crlf in true false input do @@ -408,7 +406,7 @@ do commit_chk_wrnNNO "" lf $crlf "" CRLF_LF CRLF_LF "" CRLF_LF commit_chk_wrnNNO "" crlf $crlf LF_CRLF "" LF_CRLF LF_CRLF "" commit_chk_wrnNNO auto lf $crlf "" "" "" "" "" - commit_chk_wrnNNO auto crlf $crlf LF_CRLF "" "" "" "" + commit_chk_wrnNNO auto crlf $crlf "" "" "" "" "" commit_chk_wrnNNO text lf $crlf "" CRLF_LF CRLF_LF "" CRLF_LF commit_chk_wrnNNO text crlf $crlf LF_CRLF "" LF_CRLF LF_CRLF "" done @@ -417,7 +415,8 @@ commit_chk_wrnNNO "text" "" false "$WILC" "$WICL" "$WAMIX" "$WILC commit_chk_wrnNNO "text" "" true LF_CRLF "" LF_CRLF LF_CRLF "" commit_chk_wrnNNO "text" "" input "" CRLF_LF CRLF_LF "" CRLF_LF -test_expect_success 'create files cleanup' ' +test_expect_success 'commit NNO and cleanup' ' + git commit -m "commit files on top of NNO" && rm -f *.txt && git -c core.autocrlf=false reset --hard '