Re: git-checkout doesn't seem to respect config from include.path
- From
Greg Hurrell <greg@hurrell.net>
- Date
- Feb 3, 2022, 17:39 UTC
- Message-ID
- <3f1972f3-c764-41e9-9853-8f1c303d4f6b@beta.fastmail.com>
- In-Reply-To
- <0b8222c2-7337-7e8f-33d1-7926462daac1@gmail.com>
On Thu, Feb 3, 2022, at 4:54 PM, Phillip Wood wrote:
Show 22 quoted lines
> 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.
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.
For now, I think my workaround is going to be templating out machine-specific files.
Greg