git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug report

From
Phil Hord <phil.hord@gmail.com>
Date
Oct 4, 2012, 14:19 UTC
Message-ID
<CABURp0rhHTSqQFiXEb12iKLAAjMW3+Jn-ubMy-9jNWc5068toA@mail.gmail.com>
In-Reply-To
<506D122E.2050404@emsoftware.com>
On Thu, Oct 4, 2012 at 12:35 AM, John Whitney <jjw@emsoftware.com> wrote:
> I just ran into a problem that I'm pretty sure is a bug in git. Just read
> and run this (fairly trivial) shell script to replicate.

When you added "* text=auto" in the .gitattributes file, you changed what git considers to be the checked-in file content state for test.txt. The file contents in your working directory do not match what git expects to check in. Therefore, the file appears to be different. If you commit the file "changes" the problem goes away.

This is more of a workaround than an a satisfying explanation. If you then checkout the original HEAD commit (but with .gitattributes present) you will see the problem appear again. But in a sense, adding .gitattributes this way is an act of foot-shooting. The best way forward may be to normalize your repository by removing all CR's from files in history. If you do not have this freedom, your best bet may be to normalize the repo in the current commit and move on.

Others with more intimate insight into the CRLF journey in git's past may have better advice.

Phil
Previous: John WhitneyNext: John Whitney
Message 2 of 12 in “Bug report”
  1. John WhitneyOct 4, 2012
  2. Phil HordOct 4, 2012
  3. John WhitneyOct 4, 2012
  4. Jeff KingOct 6, 2012
  5. John WhitneyOct 7, 2012
  6. Jeff KingOct 7, 2012
  7. John WhitneyOct 9, 2012
  8. John WhitneyOct 9, 2012
  9. Andrew WongOct 4, 2012
  10. John WhitneyOct 4, 2012
  11. John WhitneyOct 4, 2012
  12. Andrew WongOct 4, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.