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

Re: BUG(?): "svn diff" behaves incorrectly on symbolic links pointing to binary files

From: Vincent Lefevre <vincent+svn_at_vinc17.org>
Date: 2005-07-06 10:00:30 CEST

[Sorry, this is old, but I'm catching up with all my mail...]

On 2005-06-16 10:40:33 -0400, Charles Bailey wrote:
> On 6/15/05, Vincent Lefevre <vincent+svn@vinc17.org> wrote:
> > if in the diff, there are non-printable characters, then they should
> > be filtered out when the output is a tty. Otherwise this can mess up
> > the terminal. (I'm not sure whether this problem is unix-specific or
> > more general...)
>
> The theory here sounds reasonable. (I'm making the simplifying
> assumption that people generall don't want terminal control sequences
> sent in their diffs. Do people use them -- for instance, as text
> formatting codes -- in ways that they want to see onscreen?)

Note that if people use control sequences in their files to control
what the file would look like (for instance to change the color),
then the behavior would not necessarily be right in a diff since a
diff contains only some parts of the files, so that some important
escape sequences could be missing.

Also you can't assume that diff will always give what the user expects.
For instance, the files could be in an encoding different from the
locales, and Subversion won't convert these files.

> I'm not sure it'd be easy to define "non-printable", since that'll
> depend on the screen and the locale, though.

Well, they depend on the locale only. I think that using isprint()
would be sufficient.

> If the practical goal is to avoid wedging terminals by sending
> control sequences, perhaps it'd be enough to escape ASCII control
> codes (i.e. 0x00-0x1f) other than CR and LF.

0x7f-0x9f are also control characters with ISO-8859 encodings.
That's why isprint() should be used.

> Would such a change be specific to diffs, or would it extend to other
> terminal output, such as property values?

To all terminal output (filenames, etc.).

-- 
Vincent Lefèvre <vincent_at_vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 6 10:01:38 2005

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.