novatel / novatel_edie

The EDIE (Encode Decode Interface Engine) software development kit allows interfacing and decoding data output from NovAtel's OEM7 receivers.
MIT License
18 stars 6 forks source link

Normalize file endings in Git index #37

Closed valgur closed 5 months ago

valgur commented 6 months ago

The Git index in this repo currently contains a mix of source files with LF and CRLF line endings. This PR enables Git's autocrlf feature by adding * text=auto to .gitattributes. This forces all files in the Git index to use LF (which most of them already are do anyway). Checked are converted automatically to CRLF on Windows.

IDEs are usually smart enough to keep using the previous line endings in existing but can revert to the system default one when adding new files to the repo. It usually a good idea to prevent that by setting and forgetting the appropriate lines in .gitattributes.

To fix the Git index line endings in some other branch: git add . --renormalize and commit. To fix the line endings in your working tree: git rm --cached -r . && git reset --hard

Here's a diff of git ls-files --eol before and after:

--- pre.list
+++ post.list
@@ -34,7 +34,7 @@
 i/lf    w/crlf  attr/text=auto         examples/novatel/rxconfig_handler/rxconfig_handler.cpp
 i/lf    w/crlf  attr/text=auto         lib/logger/example_logger_config.toml
 i/lf    w/crlf  attr/text=auto         lib/logger/logger.hpp
-i/crlf  w/crlf  attr/text=auto         lib/nlohmann/json.hpp
+i/lf    w/crlf  attr/text=auto         lib/nlohmann/json.hpp
 i/lf    w/crlf  attr/text=auto         lib/nlohmann/json_fwd.hpp
 i/lf    w/crlf  attr/text=auto         lib/spdlog/async.h
 i/lf    w/crlf  attr/text=auto         lib/spdlog/async_logger-inl.h
@@ -165,14 +165,14 @@
 i/lf    w/crlf  attr/text eol=crlf     src/decoders/common/CMakeLists.txt
 i/lf    w/crlf  attr/text=auto         src/decoders/common/api/circular_buffer.hpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/api/common.hpp
-i/crlf  w/crlf  attr/text=auto         src/decoders/common/api/crc32.hpp
+i/lf    w/crlf  attr/text=auto         src/decoders/common/api/crc32.hpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/api/encoder.hpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/api/framer.hpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/api/json_reader.hpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/api/message_decoder.hpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/api/nexcept.hpp
-i/crlf  w/crlf  attr/text=auto         src/decoders/common/doc/conf.py
-i/crlf  w/crlf  attr/text=auto         src/decoders/common/doc/index.rst
+i/lf    w/crlf  attr/text=auto         src/decoders/common/doc/conf.py
+i/lf    w/crlf  attr/text=auto         src/decoders/common/doc/index.rst
 i/lf    w/crlf  attr/text=auto         src/decoders/common/src/circular_buffer.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/src/common.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/src/encoder.cpp
@@ -182,7 +182,7 @@
 i/lf    w/crlf  attr/text=auto         src/decoders/common/test/circular_buffer_unit_test.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/test/crc32_unit_test.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/test/json_reader_unit_test.cpp
-i/crlf  w/crlf  attr/text=auto         src/decoders/common/test/main.cpp
+i/lf    w/crlf  attr/text=auto         src/decoders/common/test/main.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/common/test/message_decoder_unit_test.cpp
 i/lf    w/crlf  attr/text eol=crlf     src/decoders/dynamic_library/CMakeLists.txt
 i/lf    w/crlf  attr/text=auto         src/decoders/dynamic_library/api/common_json_reader.hpp
@@ -223,8 +223,8 @@
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/api/rangecmp/common.hpp
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/api/rangecmp/range_decompressor.hpp
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/api/rxconfig/rxconfig_handler.hpp
-i/crlf  w/crlf  attr/text=auto         src/decoders/novatel/doc/conf.py
-i/crlf  w/crlf  attr/text=auto         src/decoders/novatel/doc/index.rst
+i/lf    w/crlf  attr/text=auto         src/decoders/novatel/doc/conf.py
+i/lf    w/crlf  attr/text=auto         src/decoders/novatel/doc/index.rst
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/src/commander.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/src/encoder.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/src/file_parser.cpp
@@ -236,7 +236,7 @@
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/src/rangecmp/range_decompressor.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/src/rxconfig/rxconfig_handler.cpp
 i/lf    w/crlf  attr/text eol=crlf     src/decoders/novatel/test/CMakeLists.txt
-i/crlf  w/crlf  attr/text=auto         src/decoders/novatel/test/main.cpp
+i/lf    w/crlf  attr/text=auto         src/decoders/novatel/test/main.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/test/novatel_test.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/test/proprietary_test.cpp
 i/lf    w/crlf  attr/text=auto         src/decoders/novatel/test/range_cmp_test.cpp
@@ -262,24 +262,24 @@
 i/lf    w/crlf  attr/text eol=crlf     src/hw_interface/stream_interface/CMakeLists.txt
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/common.hpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/filestream.hpp
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/inputfilestream.hpp
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/inputmemorystream.hpp
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/inputfilestream.hpp
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/inputmemorystream.hpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/inputstreaminterface.hpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/memorystream.hpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/multioutputfilestream.hpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/outputfilestream.hpp
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/outputmemorystream.hpp
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/outputmemorystream.hpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/api/outputstreaminterface.hpp
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/doc/conf.py
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/doc/index.rst
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/src/filestream.cpp
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/src/inputfilestream.cpp
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/src/multioutputfilestream.cpp
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/src/outputfilestream.cpp
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/doc/conf.py
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/doc/index.rst
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/src/filestream.cpp
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/src/inputfilestream.cpp
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/src/multioutputfilestream.cpp
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/src/outputfilestream.cpp
 i/lf    w/crlf  attr/text eol=crlf     src/hw_interface/stream_interface/test/CMakeLists.txt
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/test/filestreamunittest.cpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/test/inputfilestreamunittest.cpp
-i/crlf  w/crlf  attr/text=auto         src/hw_interface/stream_interface/test/main.cpp
+i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/test/main.cpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/test/multioutputfilestreamunittest.cpp
 i/lf    w/crlf  attr/text=auto         src/hw_interface/stream_interface/test/outputfilestreamunittest.cpp
 i/lf    w/crlf  attr/text eol=crlf     src/hw_interface/stream_interface/test/resources/decoder_bestpos.asc