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=-5.1 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 16DB420195 for ; Sun, 17 Jul 2016 08:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbcGQIQ2 (ORCPT ); Sun, 17 Jul 2016 04:16:28 -0400 Received: from mout.gmx.net ([212.227.15.18]:50714 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751376AbcGQIQY (ORCPT ); Sun, 17 Jul 2016 04:16:24 -0400 Received: from virtualbox ([37.24.141.198]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MHnzh-1bNJGC0wsH-003bh7; Sun, 17 Jul 2016 10:15:57 +0200 Date: Sun, 17 Jul 2016 10:15:55 +0200 (CEST) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: Jeff King cc: Duy Nguyen , Git Mailing List , Junio C Hamano , Sebastian Schuberth , Matthieu Moy Subject: Re: [PATCH v4] config: add conditional include In-Reply-To: <20160716164747.GA24933@sigill.intra.peff.net> Message-ID: References: <20160712164216.24072-1-pclouds@gmail.com> <20160714153311.2166-1-pclouds@gmail.com> <20160716150835.GA24374@sigill.intra.peff.net> <20160716164747.GA24933@sigill.intra.peff.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:HEn/VEr7sz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Z ibLEIuF Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Peff, On Sat, 16 Jul 2016, Jeff King wrote: > On Sat, Jul 16, 2016 at 06:36:03PM +0200, Johannes Schindelin wrote: > > > > On Sat, Jul 16, 2016 at 03:30:45PM +0200, Johannes Schindelin wrote: > > > > > > > As an alternative solution to your problem, you could of course avoid all > > > > conditional includes. Simply by adding the include.path settings > > > > explicitly to the configs that require them. Now, that would make reasoning > > > > and trouble-shooting simple, wouldn't it? > > > > > > > > And the most beautiful aspect of it: no patch needed. > > > > > > And you can just "cat" the included files directly into your > > > .git/config. We don't even need include.path. Or ~/.gitconfig, for that > > > matter. But sometimes dynamic things are convenient. > > > > Well, apparently you are not convinced by my argument. I thought it was > > pretty sound, but if you disagree, it cannot have been... > > Heh. Don't get me wrong, I do think there's room for digging ourselves a > deep hole with conditional includes, because anything dynamic opens up a > question of _when_ it is evaluated, and in what context. So any > condition should be something that we would consider static through the > whole run of the program. Looking at the "gitdir" is right on the > borderline of that, but I think it's OK, because we already have to > invalidate any cached config when we setup the gitdir, because > "$GIT_DIR/config" will have become a new source. > > So I agree it's something we need to be thoughtful about, but I think > this particular instance is useful and probably not going to bite us. FWIW I am slightly less worried about the conditional includes (it is already a horrible mess to figure out too-long include chains now, before having conditional includes, for example). I am slightly more worried about eventually needing to introduce support for something like [if-gitdir(...):section] thisSettingIsConditional = ... or even [if (worktree==...):section] anotherConditional = ... and then having two incompatible conditional constructs, one generic, the other one specific to [include]. In other words, if we already introduce a conditional construct, I'd rather have one that could easily be used for other conditions/sections when (and if) needed. I, for one, would rather have my repository-specific overrides in one single file than having a bunch of files that are included conditionally and may need to override one another: I can see the entries much easier in the single file (and group them by section) than in the multiple files. My working memory is just too filled up with other stuff to remember the contents of the other file(s). But I guess that boils down to preference. Ciao, Dscho