Private Island Networks Inc.

Line endings in Git repo

Feb 24, 2019 asked by anonymous
share
subscribe to mailing list:

Question / Issue:

Can you explain your use of line endings in the privateisland repo. I'm seeing ^M show up when running 'git diff'
X-ray Engineering Services

Responses:

Date: Feb. 24, 2019

Author: Mind Chasers

Comment:

Unfortunately some of the source files currently have CRLF line endings and some have LF line endings, but we are moving towards having all files in the repo with LF line endings only since we recognize that some developers will work on Windows (CRLF) and others will work on Mac/Linux (LF). There were some source files with mixed line endings, but we think this was resolved with commit 06aea3c5. On Mac and Linux, we're using the following git config: core.autocrlf=input On Windows, we have it set to core.autocrlf=true, which should convert line endings properly on checkout and commit. We use the common command line tools hexdump and file to determine the line endings in our files: $ hexdump top.v | more 0000000 2f 2a 0a 2a 20 20 20 20 20 20 20 74 6f 70 2e 76 ... You can see that the line ending is 0a, which is a LF $ file top.v top.v: ASCII text, this tells us that the file is consistent and each line ends with a LF We also use these tools on Windows under a CygWin environment / bash shell. We're in the process of updating our article regarding Git and Lattice Diamond and will cover this issue in more detail: https://mindchasers.com/dev/tools-diamond-git

Post your answer or comment:

your email address will be kept private
authenticate with a 3rd party for enhanced features, such as image upload
previous month
next month
Su
Mo
Tu
Wd
Th
Fr
Sa
loading