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

Re: Ignoring space changes, but not all space changes

From: <kfogel_at_collab.net>
Date: 2006-02-16 21:20:41 CET

Julian Foad <julianfoad@btopenworld.com> writes:
> He's quite right. What we really want, right now, is (Use Case 1) to
> ignore changes in whitespace between a function name or expression and
> the following opening parenthesis, in C files only. None of the
> suggested options can do that properly or even safely.
>
> [...]
>
> Any other real use cases?
>
> Use Case 3: Ignoring spacing changes in XML code. You can see where
> this is going. Not only are there different rules for where space is
> significant, but also this could only be done to a very limited extent
> on a single line, so we really need to include newlines in our
> space-ignore processing. Oh, but that's getting a bit more
> complicated than we were prepared for. Hmm.
>
> I suggest it may be unwise to provide crude tools like "ignore all
> space" which require the user to take the result with a pinch of salt,
> i.e. not trust the result. It's all very well for just viewing the
> diff by eye, but what about when we incorporate this facility in
> "merge" or "blame" or "update"?
>
> One approach would be instead to introduce a larger set of more
> specific options: e.g. ignore-space-at-eol, ignore-space-at-start,
> ignore-space-between-c-tokens, etc., as well as ignore-all-space.

I think this misses the main case for ignoring whitespace changes. In
many formats, changes in the "nonzero amount" of whitespace are
insignificant, but changes in the *presence* of whitespace are
significant. In other words

   foo bar
   foo bar
   foo bar

are often semantically all the same, but completely different from

   foobar

This distinction corresponds to the GNU diff -b and -w options. (Not
sure whether to make a 2-by-2 behavior grid differentiating horizontal
from vertical whitespace, but we can talk about that later.)

This is not really language-specific -- it's common to so many formats
as to be generally useful & deserving of native support, IMHO.

I think this has been mentioned in other recent threads. But I didn't
see it discussed anywhere in your summary mail, so I wanted to state
it in direct response.

Best,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 16 23:05:44 2006

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.