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=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS 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 04C9D1F8C6 for ; Tue, 14 Sep 2021 14:11:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233651AbhINONE (ORCPT ); Tue, 14 Sep 2021 10:13:04 -0400 Received: from cloud.peff.net ([104.130.231.41]:46952 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233654AbhINOND (ORCPT ); Tue, 14 Sep 2021 10:13:03 -0400 Received: (qmail 24188 invoked by uid 109); 14 Sep 2021 14:11:45 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 14 Sep 2021 14:11:45 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23321 invoked by uid 111); 14 Sep 2021 14:11:45 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 14 Sep 2021 10:11:45 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 14 Sep 2021 10:11:45 -0400 From: Jeff King To: Johannes Schindelin Cc: =?utf-8?B?UmVuw6k=?= Scharfe , Junio C Hamano , Taylor Blau , Git List Subject: Re: [PATCH] merge-recursive: use fspathcmp() in path_hashmap_cmp() Message-ID: References: <512abaef-d71c-9308-6a62-f37b4de69e60@web.de> <8d2e0876-9441-9665-ebb1-8cb28902014b@web.de> <8bd13e99-208b-4c22-90e6-28227593e9c4@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Sep 14, 2021 at 12:18:35PM +0200, Johannes Schindelin wrote: > Seeing as there seems to be some appetite for refactoring Git's code on > this list, I am thinking that the `struct repository *r` direction might > be the one to go for. And I mean like "move the globals into that struct" > as opposed to introducing that stack you talked about. It would even be a > refactoring where I would understand the motivation, and agree with it, > too. Oh, definitely. Regardless of whether step 2 is "pass around the repository struct" or "treat the global repository struct as a stack", step 1 must be putting repository-related globals into the struct. I don't think there can be any solution that doesn't start with that. :) And I think it can even be done incrementally with very little impact. Just s/ignore_case/the_repository->ignore_case/ in the use-sites is an improvement over the status quo. Even though it doesn't _fix_ anything, now we can easily see where the dependencies on repo-variables are. And of course follow-on steps to make sure we are passing around and accessing the right repository struct are then welcome. -Peff