strange difference display for unchanged source code

View: New views
5 Messages — Rating Filter:   Alert me  

strange difference display for unchanged source code

by SF Markus Elfring :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

The tool "cvs 1.12.12-157.2" generated the appended difference file on my openSUSE 11.1 system. The first hunk (range "-107,29 +107,27") is fine because it shows the intended source code adjustments. But I wonder about the following hunks because there are no changes shown that are really relevant.

Do you find the indicated deletion and addition of the same source lines strange, too?
(I do not see any useful updates in the later parts.)

Regards,
Markus

_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Re: strange difference display for unchanged source code

by Larry Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SF Markus Elfring writes:
>
> The tool "cvs 1.12.12-157.2" generated the appended difference file on
> my openSUSE 11.1 system.

The attachment got stripped out somewhere along the way.

> The first hunk (range "-107,29 +107,27") is fine because it shows the
> intended source code adjustments. But I wonder about the following hunks
> because there are no changes shown that are really relevant.

As far as CVS is concerned, *all* changes are "relevant".  If CVS says
there's a change, then there's a change.  Look for differences in
whitespace, particularly things like tabs vs. spaces and line endings.
--
Larry Jones

Isn't it sad how some people's grip on their lives is so precarious
that they'll embrace any preposterous delusion rather than face an
occasional bleak truth? -- Calvin


_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Parent Message unknown Re: strange difference display for unchanged source code

by SF Markus Elfring :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> The attachment got stripped out somewhere along the way.

I repeat it in this message partly.


Index: uis/org/pf/text/StringUtil.java
===================================================================
RCS file: /cvsroot/azureus/uis/org/pf/text/StringUtil.java,v
retrieving revision 1.1
diff -u -r1.1 StringUtil.java
--- uis/org/pf/text/StringUtil.java 12 Mar 2004 19:00:19 -0000 1.1
+++ uis/org/pf/text/StringUtil.java 22 Oct 2009 20:22:41 -0000
@@ -107,29 +107,27 @@
    */
   public String replaceAll( String sourceStr, String oldSubStr, String newSubStr )
   {
-    String part     = null ;
-    String result   = "" ;
+    String part     = sourceStr ;
+    StringBuilder result = new StringBuilder() ;
     int index       = -1 ;
-    int subLen      = 0 ;
+    int subLen      = oldSubStr.length() ;
 
-    subLen = oldSubStr.length() ;
-    part = sourceStr ;
     while ( ( part.length() > 0 ) && ( subLen > 0 ) )
     {
       index = part.indexOf( oldSubStr ) ;
       if ( index >= 0 )
       {
-        result = result + part.substring( 0, index ) + newSubStr ;
+        result.append(part.substring(0, index)).append(newSubStr) ;
         part = part.substring( index + subLen ) ;
       }
       else
       {
-        result = result + part ;
+        result.append(part) ;
         part = "" ;
       }
     } // while
 
-    return result ;
+    return result.toString() ;
   } // replaceAll()
 
   // -------------------------------------------------------------------------
@@ -559,7 +557,7 @@
  * @param strings The array from which to remove the strings
  * @param removeStrings The strings to be removed
  */
- public String[] remove( String[] strings, String[] removeStrings )
+ public String[] remove( String[] strings, String[] removeStrings )
  {
  if ( ( strings == null ) || ( removeStrings == null )
  || ( strings.length == 0 ) || ( removeStrings.length == 0 ) )
@@ -1132,9 +1130,9 @@
  result.put( nameValue[0], nameValue[1] ) ;
  }
 
- return result ;
- } // asMap()
-
+ return result ;
+ } // asMap()
+
  // -------------------------------------------------------------------------
 
  /**


> As far as CVS is concerned, *all* changes are "relevant".  If CVS says
> there's a change, then there's a change.

I have got my doubts. I would be interested to know if edits by other developers in other software environments will also trigger update indications for untouched parts of this source file.
http://fisheye1.atlassian.com/browse/azureus/uis/org/pf/text/StringUtil.java#r1.1

I am curious about how I can make the details of the "uninteresting" changes more visible like in the last two hunks for example. Have you got any similar experiences?

Regards,
Markus


_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Re: strange difference display for unchanged source code

by Larry Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SF Markus Elfring writes [quoting me]:
>
> > As far as CVS is concerned, *all* changes are "relevant".  If CVS says
> > there's a change, then there's a change.
>
> I have got my doubts.

I don't.  CVS does a byte-by-byte comparison of the files; it *can't*
get it wrong.

> I would be interested to know if edits by other developers in other
> software environments will also trigger update indications for untouched
> parts of this source file.

No.

> I am curious about how I can make the details of the "uninteresting"
> changes more visible like in the last two hunks for example.

Look at the file and/or the diffs with an editor that has an option to
display control characters or use a dump utility.  The "uninteresting"
changes have a bare <LF> at the end of the line in the original file
rather than the correct (for DOS/Windows) <CR><LF>.  Your editor is
fixing the defective line endings when you save the file (which is a
good thing).
--
Larry Jones

Just when I thought this junk was beginning to make sense. -- Calvin


_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Parent Message unknown Re: strange difference display for unchanged source code

by SF Markus Elfring :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Look at the file and/or the diffs with an editor that has an option to
> display control characters or use a dump utility.  The "uninteresting"
> changes have a bare <LF> at the end of the line in the original file
> rather than the correct (for DOS/Windows) <CR><LF>.  Your editor is
> fixing the defective line endings when you save the file (which is a
> good thing).

You are right.

The diff command shows the same differences. The tool "Kompare 3.4" can visually highlight the unexpected changes by a direct file comparison.

Now I have got the impression that the editor from the tool "KDevelop 3.5.5" added a few carriage return characters (0x0D) at places in the source code that I did not touch myself. Some line endings were converted to the Windows/DOS format. I would prefer a clearer display for such a conversion in the diff output.

Regards,
Markus


_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs