Skip to content

Git reads global config file, this leads to problems in some cases #706

@tostr7191

Description

@tostr7191

Expected Behavior

Being able to flash

Current Behavior

Flash fails (this is on ARM MacOS 15.3).

Steps to Reproduce

Running the binary from the command line gave me some useful log output:

{
  context: {
    repository: 'https://github.com/ExpressLRS/ExpressLRS',
    directory: '/Users/ost/Library/Application Support/ExpressLRS Configurator/firmwares/binary/ExpressLRS',
    srcFolder: 'src',
    tagName: '3.5.3'
  },
  level: 'info',
  message: 'check out tag',
  timestamp: '2025-02-20T21:08:45.477Z'
}
{
  context: {
    err: Ao [Error]: fatal: unknown style 'zdiff3' given for 'merge.conflictstyle'
    
        at Object.action (/Applications/ExpressLRS Configurator.app/Contents/Resources/app.asar/dist/main/webpack:/expresslrs-configurator/node_modules/simple-git/dist/esm/index.js:3874:25)
        at Ld.exec (/Applications/ExpressLRS Configurator.app/Contents/Resources/app.asar/dist/main/webpack:/expresslrs-configurator/node_modules/simple-git/dist/esm/index.js:3901:25)
        at /Applications/ExpressLRS Configurator.app/Contents/Resources/app.asar/dist/main/webpack:/expresslrs-configurator/node_modules/simple-git/dist/esm/index.js:1301:43
        at new Promise (<anonymous>)
        at Gc.handleTaskData (/Applications/ExpressLRS Configurator.app/Contents/Resources/app.asar/dist/main/webpack:/expresslrs-configurator/node_modules/simple-git/dist/esm/index.js:1299:16)
        at Gc.next (/Applications/ExpressLRS Configurator.app/Contents/Resources/app.asar/dist/main/webpack:/expresslrs-configurator/node_modules/simple-git/dist/esm/index.js:1283:44)
        at Generator.next (<anonymous>)
        at a (/Applications/ExpressLRS Configurator.app/Contents/Resources/app.asar/dist/main/webpack:/expresslrs-configurator/node_modules/simple-git/dist/esm/index.js:50:24) {
      task: {
        commands: [ 'checkout', '3.5.3' ],
        format: 'utf-8',
        parser: [Function: parser]
      }
    }
  },
  stack: [ undefined ],
  level: 'error',
  message: 'generic error',
  timestamp: '2025-02-20T21:08:45.512Z'
}
{
  context: { arg: { buildInProgress: false } },
  level: 'info',
  message: 'received a request to update build status',
  timestamp: '2025-02-20T21:08:45.923Z'
}

The most important line is this: err: Ao [Error]: fatal: unknown style 'zdiff3' given for 'merge.conflictstyle'. This made me realize that the problems comes from the git that you ship (/Applications/ExpressLRS Configurator.app/Contents/dependencies/darwin_amd64/git-2.29.2/bin/git) reading my ~/.gitconfig and getting confused because it does not have the correct $PATH to find zdiff3.

Possible Solution (Not obligatory)

I would suggest running the internal git command with something like GIT_CONFIG_GLOBAL="" git yadda which, according to the docs, should prevent your shipped git (which has very little idea of my system, which shell I use and have set up etc.) to read the ~/.gitconfig file. Here is the git man page for that env var.

I have tried to just comment out everything in my gitconfig, saved it, ran ELRSConfigurator again, and everything worked.

There is a gotcha from my PoV, namely that git allows to set some proxy commands in .gitconfig, like this for example. These would be ignored in that case. However, I think that the application needs internet access anyway, so this could probably be disregarded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions