| Summary: | git difftool --dir-diff causes "Mix of links and normal files error". | ||
|---|---|---|---|
| Product: | [Applications] kdiff3 | Reporter: | DmA <danielmalcolmabraham> |
| Component: | application | Assignee: | michael <reeves.87> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.8.5 | ||
| Target Milestone: | --- | ||
| Platform: | Homebrew (macOS) | ||
| OS: | macOS | ||
| Latest Commit: | https://invent.kde.org/sdk/kdiff3/commit/4c4878188c604941491b354a1df2f5c7b747ac26 | Version Fixed/Implemented In: | 1.9 |
| Sentry Crash Report: | |||
| Attachments: |
modal dialog
shows the black squares, resizing, and "Error: Conflicting File Types" |
||
|
Description
DmA
2021-03-22 17:34:16 UTC
Created attachment 136950 [details]
shows the black squares, resizing, and "Error: Conflicting File Types"
What's happening here is that kdiff3 1.8 is more careful about what it does when an error occurs. In particular unless the preferences are set to resolve links trying to compare one to a file will give the above results. Older versions sometimes charged through without reporting anything. In investigating this I also found out that links are not being resolved in all cases even when kdiff3 has been told to do so. That shouldn't be the case. The relevant code appears to be hear
if(!pOptions->m_bDmFollowFileLinks)
{
if(fi1.isSymLink() != fi2.isSymLink())
{
qCDebug(kdiffMain) << "Rejecting comparison of link to file.";
status = i18n("Mix of links and normal files.");
return bEqual;
}
else if(fi1.isSymLink() && fi2.isSymLink())
{
qCDebug(kdiffMain) << "Rejecting comparison of link to link. OK.";
bError = false;
bEqual = fi1.readLink() == fi2.readLink();
status = i18n("Link: ");
return bEqual;
}
}
This is inside MergeFileInfos::fastFileComparison which is only called when Full Analysis is turned on. I'm going to be adding an option to disable this message which was not passed on to the caller before 1.8.
This situation is created by git which internally symlinks the files in the current worktree and compares them to real files from the previous commit.
git is doing something weird? No! Say it ain't so... Thank you for looking into this and doing something about it. It looks like turning on "Follow File Links" should be enough to prevent to message from showing. It also will not show if "Full Analysis" is turned on. What will still happen is the "Operation" column in the resulting comparison tree will show "Error: Conflicting File Types". Which it probably shouldn't in this case. Can you verify this on your end? Yes, that does it. Thank you. Then I'd guess this just devolves to a documentation bug? I don't know if kdiff3 can tell that it's being called by git and do that automatically? Other? To be clear, at this point, I'm set. I'm just hoping that other people won't get lost looking for this as well. Thank you very much. I don't think it would be easy to see a git induced launch from kdiff3's perspective there is no easy way to know who launched us. I can switch the default setting to enable link resolution since this is a common use case. The default will be switched as of 1.9. The documentation update will be done in the next release Git commit 4c4878188c604941491b354a1df2f5c7b747ac26 by Michael Reeves. Committed on 26/04/2021 at 03:13. Pushed by mreeves into branch 'master'. Add FAQ for common git difftool issue FIXED-IN:1.9 M +9 -2 doc/en/index.docbook https://invent.kde.org/sdk/kdiff3/commit/4c4878188c604941491b354a1df2f5c7b747ac26 |