Author Topic: massive code changed in rev10183 of file parser_base.h and parser_base.cpp  (Read 7380 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5914
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Hi, Morten and other devs, I just found that the rev 10183 has massive code changes.
In src/plugins/codecompletion/parser/parser_base.cpp and src/plugins/codecompletion/parser/parser_base.h

You can see the changes in:
https://sourceforge.net/p/codeblocks/code/10183/

Or

https://cgit.jenslody.de/codeblocks/commit/?id=d3254c6d5cd52ea1c0bd4532966ed3f5b3a199aa

Or
WebSVN - codeblocks - Path Comparison - / Rev 10182 and / Rev 10183

Do you know what cause this problem?

My gui diff tool just show one line changes in parser_base.cpp.  :)
« Last Edit: April 06, 2015, 03:37:57 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
No idea, but, when I have this in Git under windows it is normally a line-feed change that seems to cause it.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5914
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
No idea, but, when I have this in Git under windows it is normally a line-feed change that seems to cause it.

Tim S.
Thanks.
I just installed the TortoiseSVN, and I found that revision 10182 of parser_base.cpp has Unix EOL, and  revision 10183 has Win EOL.
Check other files of this commit: both revision 10182 and 10183 of nativeparser.h has Win EOL.

I just looked at the SVN EOL property of parser_base.cpp, it is NONE. Other files have "eol-style: native".

Question: Is there a quick way to mark or check the all cpp/h files to see where they all have "eol-style: native"? I don't want to check this property one file for a time.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Question: Is there a quick way to mark or check the all cpp/h files to see where they all have "eol-style: native"? I don't want to check this property one file for a time.  :)

I found an SVN command in the past the exported all the SVN file properties; not sure what it was.
Edit: My guess on what it was is "svn proplist" http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.proplist.html
I would guess there might be a way to write a script that compares that to the ones without having that properties.

FYI: I think I reported all the files in the past that had the issue. So, you might just try the files newer than 6 months and you are likely to get most of the problem files.

I used a different method to find them. I used SVN export to somehow figure out the ones with the wrong SVN file properties.
Edit: I think I remember what I did; I created an Git Repo with LF line-ending and exported an match SVN repo with LF line-ending.
Then, I copied the SVN export over the git repo and found the changed files. Then, I checked the SVN properties for those file 90% of them did NOT have the correct native line ending set; the other had mixed line-ending in the file.

I had guessed that an well written git attribute file would solve this problem; but, each time I tried it I just seem to cause me problems using the CB Git Repo so; I gave up working on it. Here a link to my last failed attempt at a CB git attribute file https://github.com/stahta01/cb_misc/blob/master/Git-Files/.gitattributes

Tim S.
« Last Edit: April 06, 2015, 08:35:22 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5914
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Question: Is there a quick way to mark or check the all cpp/h files to see where they all have "eol-style: native"? I don't want to check this property one file for a time.  :)

I found an SVN command in the past the exported all the SVN file properties; not sure what it was.
Edit: My guess on what it was is "svn proplist" http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.proplist.html
I would guess there might be a way to write a script that compares that to the ones without having that properties.

FYI: I think I reported all the files in the past that had the issue. So, you might just try the files newer than 6 months and you are likely to get most of the problem files.
Thanks, indeed those two files were added by me in rev 9920, which is at 2014-09-28. I just add the native eol properties to those two files, and committed the change.

Quote
I used a different method to find them. I used SVN export to somehow figure out the ones with the wrong SVN file properties.
Edit: I think I remember what I did; I created an Git Repo with LF line-ending and exported an match SVN repo with LF line-ending.
Then, I copied the SVN export over the git repo and found the changed files. Then, I checked the SVN properties for those file 90% of them did NOT have the correct native line ending set; the other had mixed line-ending in the file.

I had guessed that an well written git attribute file would solve this problem; but, each time I tried it I just seem to cause me problems using the CB Git Repo so; I gave up working on it. Here a link to my last failed attempt at a CB git attribute file https://github.com/stahta01/cb_misc/blob/master/Git-Files/.gitattributes

Tim S.
You method to find the wrong svn-eol-style looks some complex to me. :)

I read some post about how git-svn handle the eol, it looks like if the file has eol-style=native, then git-svn will import the file as LF in the git repo, see: EOLs in Git and SVN | About Git, SVN, and other VCS, I quote the text below:
Quote
Why not to use git-svn if you care about EOLs?

Git-svn is a perl script that tries to convert Git contents to Subversion and vice versa. But it doesn’t perform EOLs conversion at all (absolutely ignoring svn:eol-style property and Git gitattributes), converting only Subversion repository contents to Git blobs not touching corresponding properties and attributes.

As we know, Subversion keeps all text files with LFs if svn:eol-style=native. So while cloning Subversion repository git-svn converts those text files to blobs with LFs and on Windows Git won’t convert their EOLs to native while checking out (that is inconsistent with Subversion property semantics).
Then, if I have core.autocrlf = auto in my git settings, it should work OK.

About the issue when a new file is created and add to svn, I found another method: subversion 1.8 repository dictated configuration autoprops, so @Morten, can you try to add the "svn:auto-props" for the root folder of our svn repo, so that the new added cpp/h files can have the eol-style setting automatically set correctly.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Do you know what cause this problem?
EOL changes and change of tabs to spaces and changes in indention. :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
You method to find the wrong svn-eol-style looks some complex to me. :)
Use a sophisticated tool with flat file lists and sorting by file extension to change this. I do it roughly once  year to "fix" the C::B code base.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ