Bug 886005 - svn: adding .xml files results in application/xml MIME type, preventing diffs
Summary: svn: adding .xml files results in application/xml MIME type, preventing diffs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: subversion
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Joe Orton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 886408
TreeView+ depends on / blocked
 
Reported: 2012-12-11 09:52 UTC by Florian Weimer
Modified: 2012-12-12 08:50 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
: 886408 (view as bug list)
Environment:
Last Closed: 2012-12-11 10:40:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2012-12-11 09:52:02 UTC
Description of problem:

"svn add" adds .xml files with an svn:mime-type property of "application/xml", which prevents many useful operations (including diffing).  This happens because libmagic (or "file -i") returns "application/xml" for most XML documents, and Subversion treats application/* as binary.

Version-Release number of selected component (if applicable):

subversion-1.7.7-1.fc17.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. Create an XML file (e.g., a Docbook document) with an .xml extension.
2. "svn add" it.
3. "svn diff" does not print a diff.
  
Actual results:

File has "application/xml" property.

Expected results:

File has "text/xml" property.

Comment 1 Joe Orton 2012-12-11 10:40:33 UTC
You can bypass use of libmagic by setting autoprops in ~/.subversion/config.

Is the default appropriate?  That is a large question which cannot be addressed in RH bugzilla.  An XML file may be UTF-16, for example, or it may not be usefully human-readable.

The current behaviour is by intent and by design, anyway.

Comment 2 Florian Weimer 2012-12-11 11:02:15 UTC
(In reply to comment #1)
> You can bypass use of libmagic by setting autoprops in ~/.subversion/config.
> 
> Is the default appropriate?  That is a large question which cannot be
> addressed in RH bugzilla.  An XML file may be UTF-16, for example, or it may
> not be usefully human-readable.
> 
> The current behaviour is by intent and by design, anyway.

Note sure about that, the behavior emerges from the behavior of file and subversion.  For example, on Debian, XML documents are treated as text and no svn:mime-type is set because file reports different MIME types there.

Perhaps file could report text/xml for obvious text-like XML files (Docbook, XHTML, Ant build.xml files, Gconf configuration files etc.)?  In fact, I've got a hard time finding an XML file on my system which actually deserves the application/xml MIME type.


Note You need to log in before you can comment on or make changes to this bug.