git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Haim Gelfenbeyn" <haim@hageltech.com>
To: <git@vger.kernel.org>
Subject: [Bug Report] Refresh of a repository after changing line endings behaves erratically
Date: Fri, 7 Nov 2014 20:32:58 -0800	[thread overview]
Message-ID: <031d01cffb0d$129a4340$37cec9c0$@hageltech.com> (raw)

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

                 reply	other threads:[~2014-11-08  4:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='031d01cffb0d$129a4340$37cec9c0$@hageltech.com' \
    --to=haim@hageltech.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).