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

[Bug Report] Refresh of a repository after changing line endings behaves erratically

From
HGHaim Gelfenbeyn <haim@hageltech.com>
Date
Nov 8, 2014, 04:32 UTC
Message-ID
<031d01cffb0d$129a4340$37cec9c0$@hageltech.com>

Hello, I found out that following steps outlined in https://help.github.com/articles/dealing-with-line-endings/#refreshing-a-repository-after-changing-line-endings results in different outcomes from one execution to another, done on the same repository repeatedly:

STEPS I TOOK:
1. Comitted .gitattributes file that sets some extensions to "text eol=crlf".
2. Did repository refresh:
rm -Rf *
git rm --cached -r .
git reset --hard
3. Expected result: files listed as "changed". Received result: sometimes it works, sometimes it doesn't: git reports "working directory clean".
HOW TO REPRODUCE:
1. Clone my repository with a committed .gitattributes, but still not-refreshed files:
git clone https://github.com/hageltech/msgit_test.git
2. Run this one liner while inside the git repository:
for i in `seq 1 100` ; do  rm -Rf * && git rm -q --cached -r . && git reset --hard -q && git status | wc -l ; done
3. You should be getting 100 lines of "71" (number of lines of output from git status), but in reality some lines will be "3", "20", etc. Git sometimes does not report all files as changed, when it should. 
For me, it happens with frequency of 3-5% with Git 2.2.0.rc1 on Linux, and with  frequency of around 40% with 1.9.4.msysgit.2 on Windows 7, on two different machines.  I initially thought this is Msysgit issue and took it to their issue tracker, where it was confirmed by other users: https://github.com/msysgit/git/issues/229  . However, it does occur with latest git version, compiled from git source, too.
Best regards
-- 
Haim Gelfenbeyn
Hagel Technologies Ltd.
www.hageltech.com
Message 1 of 1 in “[Bug Report] Refresh of a repository after changing line endings behaves erratically”
  1. Haim GelfenbeynNov 8, 2014

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.