OK, in that case, my guess was right, but it is also a warning that it
is a really, really good idea to define MIME types for every file that
you plan to load into Subversion. One simple trick I've used for making
binary data platform independent involves prefacing all the data with an
ASCII metadata string. The application loads up the first X bytes (all
printable 7-bit ASCII), figures out from that what the binary format for
the rest of the data is going to be, and then loads in the rest of the
data from the same file. Subversion will chew that up instantly.
Thanks for all the help!
From: Erik Huelsmann [mailto:email@example.com]
Sent: Saturday, August 11, 2007 5:01 AM
To: Ryan Schmidt
Cc: Rainer Sokoll; Karan, Cem (Civ, ARL/CISD);
Subject: Re: How does Subversion decide what gets automatically merged?
On 8/11/07, Ryan Schmidt <firstname.lastname@example.org> wrote:
> On Aug 10, 2007, at 07:55, Rainer Sokoll wrote:
> > On Fri, Aug 10, 2007 at 08:48:17AM -0400, Cem Karan wrote:
> >> Do you know the exact file types it thinks of as plain text? I
> >> mean, does it look at a file, determine that it is all 7-bit
> >> printable ASCII, and from that guess that it is text, or is there
> >> a master list of filename types that it looks at and guesses from
> >> that which are text?
> > The Book says: it's based on the MIME type:
> > http://svnbook.red-bean.com/nightly/en/svn.forcvs.binary-and-
> > trans.html
> Yes, but as it says at the end of that page, svn import will
> automatically assign an svn:mime-type to a file based on some magic
> which is not described. In any case, you can bypass the magic by
> defining in your ~/.subversion/config file which filename extensions
> should be mapped to which MIME types.
I looked up the rule in the source code it is:
Inspecting the first 1024 bytes in the file,
- 85% or more must be in the ranges 0x07-0x0D and 0x20-0x7F
- None of the bytes may be 0x00
If the above holds, the file is probably texty in the sense that it can
be merged. Consider it binary otherwise.
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Mon Aug 13 13:26:18 2007