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.6 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 73B951F89C for ; Wed, 18 Jan 2017 12:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753094AbdARMeq (ORCPT ); Wed, 18 Jan 2017 07:34:46 -0500 Received: from mout.gmx.net ([212.227.15.19]:52405 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857AbdARMep (ORCPT ); Wed, 18 Jan 2017 07:34:45 -0500 Received: from virtualbox ([37.24.141.236]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LhwLy-1cpOp22kbK-00nBQ0; Wed, 18 Jan 2017 13:34:30 +0100 Date: Wed, 18 Jan 2017 13:34:28 +0100 (CET) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: Jeff King cc: git@vger.kernel.org, Junio C Hamano , Thomas Gummerer , Andrew Arnott Subject: Re: [PATCH 2/2] Be more careful when determining whether a remote was configured In-Reply-To: <20170117214723.p5rni6wwggei366j@sigill.intra.peff.net> Message-ID: References: <41c347f22c80e96c54db34baa739b6e37e268b61.1484687919.git.johannes.schindelin@gmx.de> <20170117214723.p5rni6wwggei366j@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:vCNuloip3w4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A36xb5Nirk3h KIKjg43 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Peff, On Tue, 17 Jan 2017, Jeff King wrote: > On Tue, Jan 17, 2017 at 10:19:24PM +0100, Johannes Schindelin wrote: > > > One of the really nice features of the ~/.gitconfig file is that users > > can override defaults by their own preferred settings for all of their > > repositories. > > > > One such default that some users like to override is whether the > > "origin" remote gets auto-pruned or not. The user would simply call > > > > git config --global remote.origin.prune true > > > > and from now on all "origin" remotes would be pruned automatically when > > fetching into the local repository. > > > > There is just one catch: now Git thinks that the "origin" remote is > > configured, as it does not discern between having a remote whose > > fetch (and/or push) URL and refspec is set, and merely having > > preemptively-configured, global flags for specific remotes. > > > > Let's fix this by telling Git that a remote is not configured unless any > > fetch/push URL or refspect is configured explicitly. > > Hmm. Old versions of GitHub for Windows used to set fetch refspecs in > the system gitconfig, for a similar purpose to what you want to do with > remote.origin.prune. > > I notice here that setting a refspec _does_ define a remote. Is there a > reason you drew the line there, and not at, say, whether it has a URL? I want to err on the side of caution. That's why. Ciao, Johannes