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

ExitCode always 2 with /enableexitcode with no apparent issues #2450

Open
SESEric opened this issue Sep 25, 2024 · 5 comments
Open

ExitCode always 2 with /enableexitcode with no apparent issues #2450

SESEric opened this issue Sep 25, 2024 · 5 comments

Comments

@SESEric
Copy link

SESEric commented Sep 25, 2024

Ever since I upgraded to V2.16.42.1 i've been facing some issue with the program returning error 2 wheneever i comparer two big folders.

They seem like the program complete without any issues, and the log says that there are no differences.

I was wondering what could be wrong, is there a log that actually list what is the error ecountered?

Thank you!

@SESEric
Copy link
Author

SESEric commented Sep 25, 2024

I have just downloaded 2.16.40 and i can confirm that the same folder and call to winmerge returns 0 (as expected) as opposed to 2

@sdottaka
Copy link
Member

In my environment, I was not able to reproduce the issue where the exit code is always 2 in the latest version.

Exit code 2 indicates that an error occurred while comparing folders.

Such an error occurs when another application has a file in the folder open exclusively and WinMerge cannot compare the file.

Or, if you run WinMerge from a command prompt or batch file, the exitcode may remain at its previous value if you refer to it without waiting for WinMerge to finish.

To wait for WinMerge to finish from a command prompt or batch file, use start /wait as follows:

start /wait "" "c:\Program Files\WinMerge\WinMergeU.exe" d:\dev\winmerge\src e:\dev\winmerge\src /noninteractive /enableexitcode
echo %errorlevel%

@SESEric
Copy link
Author

SESEric commented Sep 25, 2024 via email

@sdottaka
Copy link
Member

Ah, I was able to confirm that exitcode returns 2 when folder comparison takes a long time.
I'll take a look at it later.

@sdottaka
Copy link
Member

I found that the exit status is 2 if the "Include unique subfolder contents" option in the Compare/Folder category of the Options window is turned off and one of the subfolders in the compared folders does not exist.

What about the above settings?

This issue was fixed in this commit 1646333.

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

2 participants