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

RE: diff handles addition on line end funny sometimes

From: David Balažic <david.balazic_at_hermes-softlab.com>
Date: Tue, 19 May 2009 08:33:38 +0200

Stefan Küng :

> David Balažic wrote:
> > Stefan Küng wrote:
> >
> >>> I understand that if every second character changes, then it
> >>> is considered removed/added, but in the case above it is clearly
> >>> an addition of text at the end of otherwise unchanged line.
> >> - virtual int Stop();
> >> + virtual int Stop();///< fgrg g r g
> >>
> >> *you* can recognize that there's something added at the end.
> >> But not an
> >> algorithm. Because it doesn't know that "virtual int
> Stop();" is the
> >> important part of that line. Imagine the following change:
> >>
> >> - word1 word2 word3word4
> >> + word1 word2 word3word5 word6 word7 word8 word9
> >>
> >> Would you consider this a small change? I wouldn't - even if
> >> it's only a
> >> change at the end.
> >
> > 1.) Recognizing that something is added at line end is
> actually trivial code.
>
> The code is trivial, yes. But first define what "added at the
> line end"
> means. For example,
> - word
> + word word1 word2 word3 word4 word5 word6 word7
> would that fall into that defintion?

Of course.

>
> What about
> - .
> + .*(regextest?[a-Z])?
> ?

Yes. Obviously.

<Added at end> == (<old line> == <begin of new line>)

> > 2.) Your example is different, because you removed the last
> word on the line.
>
> Define "word" please :)

The "word4" part of your example.

>
> this.
>
> is "this" the word? Or "this."? If "this", then is "." a word itself?
>
> TMerge doesn't know about words but only tokens. It doesn't understand
> languages at all.

Then how does it figure out , that the line end was added in one case, but it can't in another ?

> > Even so, I see no harm in coloring the new part as "new
> part" and the rest as
> > "unchanged part of line".
>
> There's an option in TMerge:
> View->Inline diff word wise
>
> try toggling that option - it toggles the definition of 'word'.

Tried. Has no effect on the issue.

David

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2308077

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-05-19 08:37:36 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.

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