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: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id EB5E61F5AD for ; Mon, 6 Apr 2020 13:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728356AbgDFNF0 (ORCPT ); Mon, 6 Apr 2020 09:05:26 -0400 Received: from cloud.peff.net ([104.130.231.41]:34228 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728077AbgDFNFZ (ORCPT ); Mon, 6 Apr 2020 09:05:25 -0400 Received: (qmail 23361 invoked by uid 109); 6 Apr 2020 13:05:25 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Mon, 06 Apr 2020 13:05:25 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 9787 invoked by uid 111); 6 Apr 2020 13:15:46 -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; Mon, 06 Apr 2020 09:15:46 -0400 Authentication-Results: peff.net; auth=none Date: Mon, 6 Apr 2020 09:05:24 -0400 From: Jeff King To: =?utf-8?B?VG9tw6HFoSBQcm9jaMOhemth?= Cc: git@vger.kernel.org, tomas.volf@showmax.com Subject: Re: Fwd: Q: use '-C' flag with 'git config --global' Message-ID: <20200406130524.GA1276@coredump.intra.peff.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Apr 06, 2020 at 10:48:06AM +0200, Tomáš Procházka wrote: > [includeIf "gitdir:~/Workspace/Showmax/"] > path = ~/Workspace/Showmax/.gitconfig > [...] > I get correct email setting if I run command without `--global` flag. > But What I understand from the [`git-config` > docs](https://git-scm.com/docs/git-config#_description) if no flag is > passed the values are read from system, global and local. Right, I'd expect that to work, but... > If I run commands one by one, No returns the ~correct~ expected email: > > ~ $ git -C config --system user.email > ~ $ git -C config --global user.email > tomas.prochazka5d@gmail.com > ~ $ git -C config --local user.email There's another difference when asking to read from a specific file: includes are not turned on by default. Try git -C ... config --global --includes user.email This is covered briefly in git-config(1): --[no-]includes Respect include.* directives in config files when looking up values. Defaults to off when a specific file is given (e.g., using --file, --global, etc) and on when searching all config files. This can be confusing, but was necessary to keep compatibility with scripted manipulations of those files when includes were introduced. -Peff