git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Greg Hurrell <greg@hurrell.net>,
	phillip.wood@dunelm.org.uk, git@vger.kernel.org
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>
Subject: Re: git-checkout doesn't seem to respect config from include.path
Date: Mon, 7 Feb 2022 14:05:16 +0000	[thread overview]
Message-ID: <e557db22-038b-cb78-9518-3873d7d69ee8@gmail.com> (raw)
In-Reply-To: <3f1972f3-c764-41e9-9853-8f1c303d4f6b@beta.fastmail.com>

Hi Greg

On 03/02/2022 17:39, Greg Hurrell wrote:
> On Thu, Feb 3, 2022, at 4:54 PM, Phillip Wood wrote:
>> Hi Greg
>>
>> On 02/02/2022 16:04, Greg Hurrell wrote:
>>
>>> `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'
>>
>> I think what is happening is that git parses each line of the config
>> file as it reads it so the old version of git sees "zdiff3" and errors
>> out before it reads the include line.
> 
> That gave me the idea of moving the `include.path` setting higher up in
> the file, to see if `git checkout` would consult that value first, but
> it doesn't work; `git config merge.conflictStyle` shows the value from
> the file indicated in `include.path`, but a command like `git checkout`
> still dies based on the value in ~/.gitconfig.

Yes, you need to move the "zdiff3" setting into an include file that is 
only read by recent versions of git.

> Overall this points to the general problem that it is not only hard to
> make a single config that works on different machines, but it's hard to
> make a _combination_ of files that works on different machines.

If you make sure that you are only including files containing recent 
config keys on machines running recent git versions then it should work 
but arranging for that to happen is not necessarily easy

Best Wishes

Phillip

> For now, I think my workaround is going to be templating out
> machine-specific files.
> 
> Greg
> 


  parent reply	other threads:[~2022-02-07 14:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 16:04 git-checkout doesn't seem to respect config from include.path Greg Hurrell
2022-02-02 22:57 ` 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 [this message]
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=e557db22-038b-cb78-9518-3873d7d69ee8@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=greg@hurrell.net \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=sandals@crustytoothpaste.net \
    /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).