Author Topic: Auto detect text files and perform LF normalization  (Read 604 times)

nidud

  • Member
  • *****
  • Posts: 1371
    • https://github.com/nidud/asmc
Auto detect text files and perform LF normalization
« on: January 11, 2017, 01:25:22 AM »
I finally upgraded from XP to Win7 so I'm now able to use some of these GitHub tools to apply changes to the account. I am however not familiar with all the settings so by creating the Asmc account I just went with the default configuration.

As it turns out the default seems to be to translate all CR/LF pair to LF, so all the text files was stripped in the .ZIP file when I downloaded from Windows.

I applied the following changes to the .gitattributes file:
Code: [Select]
# Auto detect text files and perform LF normalization
#* text=auto
* text eol=crlf

This seems to work not..

The solution appear to be declaring each file type manually:
Code: [Select]
# Auto detect text files and perform LF normalization
* text=auto

# Declare files that will always have CRLF line endings on checkout.
*.c text eol=crlf
*.h text eol=crlf
*.inc text eol=crlf
*.ini text eol=crlf
*.asm text eol=crlf

« Last Edit: January 11, 2017, 09:29:54 AM by nidud »

nidud

  • Member
  • *****
  • Posts: 1371
    • https://github.com/nidud/asmc
Re: Auto detect text files and perform LF normalization
« Reply #1 on: January 11, 2017, 01:58:37 AM »
Well, that fixed the text files but now the binaries are messed up. Tried to remove the configuration files so now the binaries are fine but the text files messed up again. What a mess.

Think I actually have to RTFM now :biggrin:

nidud

  • Member
  • *****
  • Posts: 1371
    • https://github.com/nidud/asmc
Re: Auto detect text files and perform LF normalization
« Reply #2 on: January 11, 2017, 09:33:04 AM »
The reason I found out was a stack-fault in the editor while reading the syntax highlighting settings from the .INI file. The rest of the tools works fine so without the buggy ini-code I wouldn't have noticed the difference.

I assumed the auto setting was based on detecting the OS used when downloading the .ZIP file but that doesn't seem to be the case, at least from the web menu at the site.