[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Do not display a binary prop diff in interactive conflict resolver

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Fri, 4 Dec 2009 07:31:19 +0100

> >> [[[
> >> Do not display a binary property diff in the interactive conflict
> >> resolver.
> >>
> >> * subversion/include/svn_io.h
> >> (svn_stream_detect_binary_mimetype): New. Declare.
> >>
> >> * subversion/libsvn_subr/stream.c
> >> (svn_stream_detect_binary_mimetype): Check if atleast 85 % of the
> >> bytes fall within the ascii range of printable characters.
> >>
> >> * subversion/libsvn_wc/props.c
> >> (maybe_generate_propconflict): Call ..binary_mimetype() on the
> >> mergestream. Set the conflict description according to the outcome.
> >>
> >> * subversion/svn/conflict-callbacks.c
> >> (svn_cl__conflict_handler): Print err msg if desc->is_binary when
> >> invoking 'diff-full'.
> >>
> >> Patch by: Daniel Näslund <daniel{_AT_}longitudo.com>
> >> ]]]

On Fri, Dec 04, 2009 at 11:42:06AM +1100, Gavin 'Beau' Baumanis wrote:
> Ping.
> This Patch submission has received no new comments.

I'm giving up on this one for now. I wanted to detect whether some
properties were binary or not using the mechanism in
svn_io_detect_binary_mimetype() but that one is flawed and only checks
if text is outside the printable ASCII range. Japanese text will be
treated as binary!

I'm hoping that something will come out of the discussion in [1]
regarding how to classify files as binary or text. My own humble
suggestion was to use libmagic. I think that somewhere within that
the aboved mentioned thread someone said that libmagic has flaws too but
I can't find it now.

In the end, how often do we use binary properties? Not often at all is
my guess?

Daniel

[1] http://svn.haxx.se/dev/archive-2009-11/index.shtml#536
Received on 2009-12-04 07:32:01 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.