Version: unspecified (using Devel) OS: Linux When opening git pathc, Kompare shows error "The diff is malformed. Some lines could not be parsed and will not be displayed in the diff view." Also, Kompare shows dummy a/ and b/ prefixes as directories. Also, Kompare recognizes git patches as "application/mbox" files, and MIME-type-based logic does not work for them ("text/x-patch" is expected) Reproducible: Didn't try Steps to Reproduce: Open any git patch Actual Results: Error about malformed patch is shown. Git patch is not visualized in optimal way Expected Results: Better support for git patches
Yes, the check for diff validity is still too strict, even after the fix for bug #249976. :-(
I think it should work the next way: 1) If file is recognized as "application/mbox"? search for "diff --git" inside. If found, strip "mail" part and parse remaining diff
I don't think the mail prefix is what's causing the "malformed" warning, it's some other non-diff junk, probably the git version at the end.
If so, strip everything outside "---" guards: <Mail header> --- <Actual patch here> --- <git version>