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.1 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=no 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 A779C1F404 for ; Tue, 13 Feb 2018 18:52:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965586AbeBMSwm (ORCPT ); Tue, 13 Feb 2018 13:52:42 -0500 Received: from mout.web.de ([212.227.17.12]:38515 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965457AbeBMSwl (ORCPT ); Tue, 13 Feb 2018 13:52:41 -0500 Received: from [192.168.178.36] ([79.237.252.254]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MIvPJ-1enbVD2sY5-002ZuH; Tue, 13 Feb 2018 19:52:34 +0100 Subject: Re: [PATCH 003/194] object-store: move packed_git and packed_git_mru to object store To: Junio C Hamano Cc: Stefan Beller , git , Jonathan Nieder References: <20180205235508.216277-1-sbeller@google.com> <20180205235508.216277-4-sbeller@google.com> <212094a6-f1bd-c4cd-01f9-e819a701cfac@web.de> From: =?UTF-8?Q?Ren=c3=a9_Scharfe?= Message-ID: <8b8f6e8c-9077-793b-81d7-8769eee31e66@web.de> Date: Tue, 13 Feb 2018 19:52:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-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AhepAqPXIbhCPtTJmRAArpOijtgnhID4Za Zom2mB7NZrpiJiseLUo+RYwicjmkn6HQ30yA9VgnqvAGWUXdY0= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 12.02.2018 um 22:48 schrieb Junio C Hamano: > René Scharfe writes: > >> Am 12.02.2018 um 22:04 schrieb Junio C Hamano: >>> Stefan Beller writes: >>> >>>> I thought it may be a helpful >>>> for merging this series with the rest of the evolved code base which >>>> may make use of one of the converted functions. So instead of fixing >>>> that new instance manually, cocinelle could do that instead. >>> >>> Having the .cocci used for the conversion *somewhere* would indeed >>> be helpful, as it allows me to (1) try reproducing this patch by >>> somebody else using the file and following the steps in order to >>> audit this patch and (2) catch new places that need to be migrated >>> in in-flight topics. >>> >>> But placing it in contrib/coccinelle/ has other side effects. >> >> Running "make coccicheck" takes longer. What other downsides are >> there? > > Once the global variable packed_git has been migrated out of > existence, no new code that relies on it would be referring to that > global variable. If coccicheck finds something, the suggested rewrite > would be turning an unrelated packed_git (which may not even be the > right type) to a reference to a field in a global variable, that > would certainly be wrong. Ugh, yes. The semantic patch in question doesn't contain any type information. I don't know how to match a variable by name *and* type. Here's the closest I can come up with to a safe and complete transformation, but it only handles assignments: @@ struct packed_git *A; identifier B = packed_git; @@ - A = B + A = the_repository->objects.packed_git Seeing the many for loops, I'm tempted to suggest adding a for_each_packed_git macro to hide the global variable and thus reduce the number of places to change at cutover. Coccinelle doesn't seem to like them, though. A short semantic patch with a limited time of usefulness and possible side-effects can easily be included in a commit message, of course.. René