git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Phillip WoodNext: Greg Hurrell
Message 5 of 10 in “git-checkout doesn't seem to respect config from include.path”
  1. Greg HurrellFeb 2, 2022
  2. brian m. carlsonFeb 2, 2022
  3. Greg HurrellFeb 3, 2022
  4. Phillip WoodFeb 3, 2022
  5. Greg HurrellFeb 3, 2022
  6. Greg HurrellFeb 3, 2022
  7. Phillip WoodFeb 7, 2022
  8. Junio C HamanoFeb 3, 2022
  9. Phillip WoodFeb 7, 2022
  10. Junio C HamanoFeb 7, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.