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=-3.0 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,T_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 3B7FA202F2 for ; Sun, 19 Nov 2017 10:03:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750815AbdKSKDD (ORCPT ); Sun, 19 Nov 2017 05:03:03 -0500 Received: from mout.web.de ([212.227.15.14]:64988 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750788AbdKSKDC (ORCPT ); Sun, 19 Nov 2017 05:03:02 -0500 Received: from [192.168.178.36] ([91.20.49.242]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MF3iV-1eNGCc2Fw3-00GG7B; Sun, 19 Nov 2017 11:02:53 +0100 Subject: Re: [PATCH 1/6] t4051: add test for comments preceding function lines To: Eric Sunshine Cc: Git List , Junio C Hamano , Vegard Nossum References: <790c2344-a71e-7089-9000-f9b37a4a5cd9@web.de> From: =?UTF-8?Q?Ren=c3=a9_Scharfe?= Message-ID: Date: Sun, 19 Nov 2017 11:02:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:DPUfuunQpx7ZxHGPQLFOJwuSOx7D/tbcSEybkZkkH9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cxmg= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 19.11.2017 um 02:18 schrieb Eric Sunshine: > On Sat, Nov 18, 2017 at 1:04 PM, René Scharfe wrote: >> When showing function context it would be helpful to show comments >> immediately before declarations, as they are most likely relevant. Add >> a test for that. >> >> Signed-off-by: Rene Scharfe >> --- >> diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh >> @@ -85,6 +85,10 @@ test_expect_success 'setup' ' >>> +test_expect_failure ' context includes comment' ' >> + grep "^ .*Hello comment" changed_hello.diff >> +' > > This shows only that the the "* Hello comment." line is in the context > but says nothing about the entire comment block being included (which > patch 3/6 implements). Perhaps the test could be more thorough? You say that as if it was a bad thing. That line represents 33% of your suggested full-comment metric, i.e. more than nothing. But more importantly it's the actual comment payload. The leading "/*" line is included as a consequence of the employed heuristic, but a more refined one might omit it as it doesn't actually contain any comment. Not sure if we actually want to tweak our heuristic further, but the test is meant to check only if the interesting part is present and give leeway regarding other implementation details. > >> diff --git a/t/t4051/hello.c b/t/t4051/hello.c >> index 63b1a1e4ef..73e767e178 100644 >> --- a/t/t4051/hello.c >> +++ b/t/t4051/hello.c >> @@ -1,4 +1,7 @@ >> >> +/* >> + * Hello comment. >> + */ >> static void hello(void) // Begin of hello >> {