question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line endings change warning phrasing is backwards

See original GitHub issue

Description

The warning that line endings for a file have changed has it backwards, saying the file’s line endings have change from “what it is now” to “what it was”, instead of vice versa. See screenshot below illustrating the problem. This confused me for a bit when it first happened.

lf-crlf

Version

  • GitHub Desktop: 1.4.0
  • Operating system: Windows 10 Pro x64 [10.0.17134.285]

Steps to Reproduce

  • Change the line endings of a file
  • View diff in GitHub Desktop
  • Note that change described in warning text is backwards

Expected Behavior

The warning to say “Line endings have changed from ‘CRLF’ to ‘LF’”

Actual Behavior

The warning actually says “Line endings have changed from ‘LF’ to ‘CRLF’”

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
fatcerberuscommented, Feb 3, 2019

FWIW it seems to be an impedance mismatch between Desktop and Git: Git is warning “I’m going to change the line endings when I make the commit” while Desktop is misappropriating that message to mean “the line endings have changed from what they were before”—which is not (necessarily) true.

1reaction
fatcerberuscommented, Sep 26, 2018

Based on that third line, it seems that it’s deciding how to warn based on the message from git diff–a message which is itself pretty confusing. Git’s warning actually means something closer to “(CRLF|CR|LF) in the working tree will be replaced with (CRLF|CR|LF) in the repo when committed”. In other words it’s not necessarily telling you that the file’s line endings changed (although in practice this is usually the case), but rather that the line endings in the working tree simply don’t match what Git has been configured to commit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LF will be replaced by CRLF", is that warning tail backward?
Rephrase the warning to be clear about when the line endings will be changed and what they will be changed to. On a...
Read more >
Windows git warning LF will be replaced by CRLF is ... - Edureka
When I git commit, it says: warning: LF will be replaced by CRLF. Is this warning tail backward? I edit file in Windows,...
Read more >
Backmasking - Wikipedia
Backmasking is a recording technique in which a message is recorded backward onto a track that is meant to be played forward. It...
Read more >
RFC 7230: Hypertext Transfer Protocol (HTTP/1.1)
The interpretation of a header field does not change between minor ... ending with CRLF. status-line = HTTP-version SP status-code SP reason-phrase CRLF...
Read more >
Palindrome Examples: 26 Words That Are the Same ...
Palindrome words and phrases are spelled the same backward and ... these new grammar rules that have changed within the last decade.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found