ExpressLRS / ExpressLRS/ExpressLRS-Configurator

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

Open
#706 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
849
Forks
179
Avg merge
1h 34m
Merged PRs (30d)
1

Description

## 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 ()
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 ()
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](https://git-scm.com/docs/git#Documentation/git.txt-codeGITCONFIGGLOBALcode) 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](https://git-scm.com/docs/git-config#Documentation/git-config.txt-coregitProxy) 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.