Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tostr7191 opened this issue Feb 20, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@tostr7191
Copy link

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.

@tostr7191 tostr7191 added the bug Something isn't working label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant