Git integration question
Posted: Fri Feb 11, 2022 4:52 pm
Why does https://www.prestosoft.com/edp_versioncontrol.asp recommend setting merge.trustExitCode to false?
A forum for discussing ExamDiff Pro, FtpVC, and ExamDiff
https://www.prestoforums.com/
And the merge tool integration:difftool.trustExitCode
Exit difftool if the invoked diff tool returns a non-zero exit status.
See the --trust-exit-code option above for more details.
--[no-]trust-exit-code
git-difftool invokes a diff tool individually on each file. Errors reported by the diff tool are ignored by default. Use --trust-exit-code to make git-difftool exit when an invoked diff tool returns a non-zero exit code.
git-difftool will forward the exit code of the invoked tool when --trust-exit-code is used.
So it basically depends on when EDP returns an error code.If the custom merge tool correctly indicates the success of a merge resolution with its exit code, then the configuration variable mergetool.<tool>.trustExitCode can be set to true. Otherwise, git mergetool will prompt the user to indicate the success of the resolution after the custom tool has exited.
mergetool.<tool>.trustExitCode
For a custom merge command, specify whether the exit code of the merge command can be used to determine whether the merge was successful. If this is not set to true then the merge target file timestamp is checked and the merge assumed to have been successful if the file has been updated, otherwise the user is prompted to indicate the success of the merge.
EDP returns a non-zero exit code in cases where no error occurred.Comparison Exit Codes
0 identical files or directories
1 different files or directories
2 an error occurred
Merging Exit Codes
0 no conflicts
1 some conflicts were found
2 an error occurred
Code: Select all
git difftool --dir-diff <some branch> <some other branch>
Well then we'll reverse the recommendation back to what it was.Actually, from reading the help page, it appears that the original suggestion was correct.
Not directly but you can always export your options to a file and use the /g option to use the saved options files.Is it possible to disable the external change monitoring via a command-line switch?
It seems to me exactly the opposite, as is customary.Alexo wrote: Sun Feb 13, 2022 5:34 pm EDP returns a non-zero exit code in cases where no error occurred.
Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
The behaviour is still problematic, and disabling the notifications is a workaround at best (not an optimal one, since any changes need to be exported again).Not directly but you can always export your options to a file and use the /g option to use the saved options files.
What exactly do you want to be investigated? I'm not sure what the problem is.This did not happen with other diff programs that are aware of file changes (BC4 and others).
Can this be investigated?
As I wrote above:psguru wrote: Mon Feb 14, 2022 2:36 pm What exactly do you want to be investigated? I'm not sure what the problem is.
I do not know what causes the directory comparison window to decide that files are changing when the file comparison windows don't.Alexo wrote: Sun Feb 13, 2022 10:47 pm Running the followingDisplays a directory comparison as expected, but then I start getting incessant pop-ups that files got changed prompting to re-compare the directories. Indeed, many of the displayed files start changing to italics as if they are getting changed, but not all of them.Code: Select all
git difftool --dir-diff <some branch> <some other branch>
Interestingly, when I clicked on a line to open a file comparison, and waited, I got a notification for that file in directory comparison window, but did not get any notification in the file comparison window, suggesting that the file did not actually change.
The --dir-diff option pushes all the work off to the diff tool itself: Git just extracts the two commits to be compared into two temporary directories, and then sends the names of the two directories to the diff tool. So everything that shows up from the moment the diff tool starts, until the entire git difftool command finishes, is because of the tool.
Both directory and file comparison use the same file system monitoring WIN32 API, ReadDirectoryChangesW. There is no way for me to answer your question without having a concrete reproducible scenario.I do not know what causes the directory comparison window to decide that files are changing when the file comparison windows don't.
There must be some files that are being created/deleted/modified while the directory comparison view is on. You should be able to inspect your file system to see what they are. You can even use a tool like https://www.codeproject.com/Articles/95 ... angesW-all, or similar, to have a look at what's changing.I also asked the same question on SO and got the following comment:
The --dir-diff option pushes all the work off to the diff tool itself: Git just extracts the two commits to be compared into two temporary directories, and then sends the names of the two directories to the diff tool. So everything that shows up from the moment the diff tool starts, until the entire git difftool command finishes, is because of the tool.
Well, yes and no.psguru wrote: Tue Feb 15, 2022 9:38 am There must be some files that are being created/deleted/modified while the directory comparison view is on. You should be able to inspect your file system to see what they are.