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

Invalid exit code handling for IntelliJ mergetool #206

Closed
arcticicestudio opened this issue Jun 17, 2019 · 0 comments
Closed

Invalid exit code handling for IntelliJ mergetool #206

arcticicestudio opened this issue Jun 17, 2019 · 0 comments

Comments

@arcticicestudio
Copy link
Owner

arcticicestudio commented Jun 17, 2019

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 will error because the temporary files passed to idea merge as parameters are 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 for more details.

To fix the problem the mergetool.intellij.trustExitCode option should be 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 to 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 can be used and set the path to a additional file that will only be linked by snowsaw for macOS based hosts.

Not that the include statement/block must be placed at the bottom of the main Git configuration file in order to override the initial/default block!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant