Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix invalid exit code handling for IntelliJ
mergetool
When using IntelliJ as `mergetool` and setting `mergetool.intellij.trustExitCode` to `true`, the `mergetool.intellij.cmd` gets called for all files immediately. After IntelliJ gets closed for the first processed file, all other calls errored because the temporary files passed to `idea merge` as parameters were not valid anymore causing the app to exit. The problem is that Git is not able to interpret or track started IntelliJ process and fails to listen for the exit code, causing the calls to be fired immediately. This problem can be narrowed down to macOS while it works fine for Linux systems. See the official Git documentation about the `mergetool` command (1) for more details. To fix the problem the `mergetool.intellij.trustExitCode` option has been set to `false` and `mergetool.intellij.prompt` to `true` to force Git to wait for the user to confirm the merge is completed and the app window has been closed before continuing with the next queued file. The only impact is that it requires to press `y` or `n` after solving a conflict instead of only closing the app window and waiting for it t reopen again for the next file. This is also limited to macOS so the impact is very small compared to the broken state when not applying the fix. In order to dynamically apply the configurations only for macOS systems a `[include]` block is used setting the path to a additional file that is only linked by "snowsaw" for macOS based hosts. Not that the "include" statement/block is placed at the bottom of the main Git configuration file in order to override the initial/default block! References: (1) https://git-scm.com/docs/git-mergetool Closes GH-206
- Loading branch information