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

Re: Bug report

From
JWJohn Whitney <jjw@emsoftware.com>
Date
Oct 4, 2012, 16:10 UTC
Message-ID
<506DB500.4010803@emsoftware.com>
In-Reply-To
<CABURp0rhHTSqQFiXEb12iKLAAjMW3+Jn-ubMy-9jNWc5068toA@mail.gmail.com>
Phil,

Thank you for your response. I do see the dilemma, but having no possible "unmodified" state is extremely inconvenient and, as shown, breaks basic git operations.

I guess my thought is that if git doesn't allow CRs to be checked in, then it should strip the CRs when checking the file out, and consider that form (or both forms) as "unmodified". It just doesn't make sense to me that files are considered modified immediately after checkout.

Any thoughts as to why this would not work?
    ---John
On 10/4/12 9:19 AM, Phil Hord wrote:
Show 22 quoted lines
> 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
>
-- 
Great support for great users! Please visit http://emsoftware.com/support/ for our support policies, instructions and FAQs.
Previous: Phil HordNext: Jeff King
Message 3 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.