git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Greg Hurrell" <greg@hurrell.net>
To: git@vger.kernel.org
Subject: git-checkout doesn't seem to respect config from include.path
Date: Wed, 02 Feb 2022 17:04:26 +0100	[thread overview]
Message-ID: <ee1dd453-e698-440a-911b-d14389e33715@beta.fastmail.com> (raw)

Hi,

Not sure if this is confined specifically to `git-checkout`, but that's
the command I noticed the issue with:

With the release of the v2.35.0 and the "zdiff3" setting for
"merge.conflictStyle", I find myself wanting to use "zdiff3" on machines
running the new version, and falling back to "diff3" on machines with an
older version.

To this end, I have a ~/.gitconfig that contains:

    [merge]
    	conflictStyle = zdiff3
    [include]
    	path = ~/.gitconfig.local

The idea is that I can use the same `~/.gitconfig` on every machine I
use, but on machines that only have an older Git version, I drop in a
~/.gitconfig.local with overrides like this:

    [merge]
    	conflictStyle = diff3

`git config --get merge.conflictStyle` correctly reports that my setting is
"diff3" on such machines, and `git config --get-all merge.conflictStyle`
shows:

    diff3
    zdiff3

In other words, it knows that I have multiple values set, but it uses
a last-one-wins policy.

However, when I try to run a command like `git checkout -b something`,
Git dies with:

    fatal: unknown style 'zdiff3' given for 'merge.conflictstyle'

So, it looks like something in `git-checkout`'s option processing is
causing it to disregard the override set via "include.path". In fact, it
even disregards a value passed in with `-c` like this:

    git -c merge.conflictStyle=diff3 checkout -b something

Does this sound like a bug, or are my expectations off? I'd be happy to
look into fixing this, but first would like to know whether it is
expected behavior.

Cheers,
Greg

             reply	other threads:[~2022-02-02 16:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 16:04 Greg Hurrell [this message]
2022-02-02 22:57 ` git-checkout doesn't seem to respect config from include.path brian m. carlson
2022-02-03  7:48   ` Greg Hurrell
2022-02-03 15:54 ` Phillip Wood
2022-02-03 17:39   ` Greg Hurrell
2022-02-03 17:42     ` Greg Hurrell
2022-02-07 14:05     ` Phillip Wood
2022-02-03 18:07   ` Junio C Hamano
2022-02-07 14:01     ` Phillip Wood
2022-02-07 23:50       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee1dd453-e698-440a-911b-d14389e33715@beta.fastmail.com \
    --to=greg@hurrell.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).