Results 1 to 4 of 4

Thread: Inconsistent Line Endings

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Inconsistent Line Endings

    Sometimes when I open up several of my projects I get a warning that says:

    "The line endings in the following file are not consistent. Do you want to normalize the line endings"

    I click Yes (defaults to Windows CR LF) & proceed to work on the program. Then I might open it up several days later & get the same warning.
    What causes line endings to become inconsistent in the first place & why don't they stick when I say yes to normalize them?

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,110

    Re: Inconsistent Line Endings

    I've seen this, as well, in older ASP.NET WebForms projects that had been generated by a code generator. I always assumed that the cause was some result of the code generator. I opened those so infrequently that I never noticed that the change hadn't stuck until you mentioned it. Now that you mention it, I think the change didn't stick for me, either.
    My usual boring signature: Nothing

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Inconsistent Line Endings

    Something is partially overwriting those files other than your code editor so the first order of business is to determine what that is.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,398

    Re: Inconsistent Line Endings

    I get this all the time. The issue is compounded by the fact that developers are in different operating systems with differing environments. Some use Visual Studio, some use Visual Studio Code, and some use VIM. Each one of those setups can then further be configured with specific line endings.

    Just about anytime I touch a file in any of our projects I will get that message and if I tell Visual Studio to fix the line endings then git will treat each line change as a change which understandably upsets the reviewers.

    I've just been trained to tell Visual Studio to ignore it and move on anytime I open a file. I'm pretty sure that's just called learned helplessness though.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width