MantisBT - Doomseeker
View Issue Details
0003740Doomseeker[All Projects] Cleanuppublic2020-01-27 21:242021-08-16 19:15
WubTheCaptain 
WubTheCaptain 
normaltrivialsometimes
closedwon't fix 
1.3.1 
1.3.2 
0003740: Newlines in git show may show up as ^M
I keep seeing ^M in "git show" inconsistently, so I'm interested to check if the newlines need normalization to DOS or Linux newlines (CR LF, or LF).
No tags attached.
related to 0003758closed Pol M Non-dominating UNIX newline in src/core/datapaths.h 
Issue History
2020-01-27 21:24WubTheCaptainNew Issue
2020-01-27 21:24WubTheCaptainStatusnew => assigned
2020-01-27 21:24WubTheCaptainAssigned To => WubTheCaptain
2020-01-27 21:24WubTheCaptainPrioritynormal => low
2020-01-29 15:04WubTheCaptainTarget Version => 1.3.3
2020-01-30 14:00WubTheCaptainNote Added: 0021161
2020-01-30 14:00WubTheCaptainAssigned ToWubTheCaptain =>
2020-01-30 14:00WubTheCaptainStatusassigned => new
2020-01-30 14:01WubTheCaptainNote Added: 0021162
2020-01-30 14:02WubTheCaptainPrioritylow => normal
2020-01-30 14:02WubTheCaptainReproducibilityhave not tried => sometimes
2020-01-30 14:03WubTheCaptainNote Edited: 0021162bug_revision_view_page.php?bugnote_id=21162#r12980
2020-01-30 14:05WubTheCaptainNote Added: 0021163
2020-01-30 17:09ZalewaNote Added: 0021168
2020-01-30 17:10ZalewaNote Edited: 0021168bug_revision_view_page.php?bugnote_id=21168#r13010
2020-01-30 17:14WubTheCaptainNote Added: 0021169
2020-01-30 17:15WubTheCaptainNote Added: 0021170
2020-01-30 17:17WubTheCaptainStatusnew => resolved
2020-01-30 17:17WubTheCaptainResolutionopen => won't fix
2020-01-30 17:17WubTheCaptainAssigned To => WubTheCaptain
2020-01-30 17:20WubTheCaptainNote Edited: 0021170bug_revision_view_page.php?bugnote_id=21170#r13012
2020-01-30 17:26WubTheCaptainRelationship addedrelated to 0003758
2021-08-07 16:53Blzut3Statusresolved => closed
2021-08-16 19:15WubTheCaptainTarget Version1.3.3 => 1.3.2

Notes
(0021161)
WubTheCaptain   
2020-01-30 14:00   
unix2dos: 221,987 lines diff
dos2unix: 118,154 lines diff

What do?
(0021162)
WubTheCaptain   
2020-01-30 14:01   
(edited on: 2020-01-30 14:03)
find src/ -type f -print0 | xargs -0 dos2unix
find src/ -type f -print0 | xargs -0 unix2dos

not including what little is in root

(0021163)
WubTheCaptain   
2020-01-30 14:05   
For comparison, Doomseeker 1.3.1's src/ directory is 120k LOC.
$ cloc src/
     864 text files.
     863 unique files.
      24 files ignored.

github.com/AlDanial/cloc v 1.82  T=1.10 s (764.3 files/s, 147838.6 lines/s)
---------------------------------------------------------------------------------------
Language                             files          blank        comment           code
---------------------------------------------------------------------------------------
C++                                    324           7893           9197          44796
Qt Linguist                             18            255              0          30811
Qt                                      58              3              0          16453
C/C++ Header                           377           4970          16546          13964
C                                       42           2009            717          12621
CMake                                   19            167            409           1565
Windows Resource File                    1              8              1             46
Windows Module Definition                1              2              0             41
---------------------------------------------------------------------------------------
SUM:                                   840          15307          26870         120297
---------------------------------------------------------------------------------------
(0021168)
Zalewa   
2020-01-30 17:09   
(edited on: 2020-01-30 17:10)
Newline consistency across the whole project is not needed. It's only needed to have newline consistency in a file. If there are inconsistent lines in some file then this file has problems and should be fixed.

There's tools/normalize_nl.py in the Doomseeker repo that can scour a whole subdirectory tree and alter all files within it to have the dominating newline style in each file be the consistent one in that single file.

Files that are 3rd party should not be modified even if they have inconsistent newlines.

(0021169)
WubTheCaptain   
2020-01-30 17:14   
python3 ./tools/normalize_nl.py src/ cpp came up clean (had to figure out how to use that tool), so I guess this can be resolved as "denied" or something?
I would prefer running dos2unix on every Doomseeker & Wadseeker source file, but hey this is alright.
(0021170)
WubTheCaptain   
2020-01-30 17:15   
(edited on: 2020-01-30 17:20)
Actually, one line is not consistent in src/core/datapaths.h.