-
Notifications
You must be signed in to change notification settings - Fork 317
git status always show random files are modified on Win7-x64/SSD driver. #229
Comments
Well I can't reproduce that here. |
Maybe it is 'line endings' issue ? Reference:
|
I have a very similar problem: after "git clone", different set of files is reported as "modified". This is related to CRLF conversion for sure -- all files in question are defined in .gitattributes, and some of them may have been comitted with CRLF endings. The real problem, as I see it, is that the results are inconsistent. After, say, 10 runs of "git clone" and "git status", about 25% reports are "clean", and the rest report some files as changed. But the number of files changes from run to run. Really confusing. This is not related to SSDs, at least for me. Happens on SSDs and on normal hard disks. I do have Windows 7 x64, though. |
Does it happen in v1.9.4.msysgit.2? |
Yes, I'm using the latest version. |
@hageltech |
I tried with -n and then did checkout after the clone finished. Still the same problem. Some checkouts were dirty, some were not. Moreover, I did one more test: did one "checkout -n", then copied the bare repository several times using simple filesystem copy, and did checkout in each of them. Some were dirty, some were not, again. So the problem seems to be in the checkout, not in clone. |
Perhaps, try to locate one modified file and use |
Did in both trees (where the file is ok and where it is reported as modified). Both return the same: This is what I have in .gitattributes for this extension: This is what I have in gitconfig (in core section, related to this issue, possibly): |
Then, what is the EOL of that file actually? LF? |
Nope, that's the weird thing: both cases, file is correctly CRLF in the working directory. However, it is shown as "modified" sometimes, and when it does, I cannot make that status go away by any means I know (.e.g git reset --hard, etc.) |
Could you please try to create a dummy problematic repository? |
@hageltech: Do you have a virus scanner running in the background? |
@YueLinHo: OK, I couldn't cause this issue to appear with very small dummy testing repositories. However, I did this: I took one existing repository I have no problem sharing (it's open source), added my .gitattributes file there, and the issue started to appear. So: Clone this repo: Then clone the repo locally several times (at least 10 times to be sure): See how "git status | wc -l" reports different number of files as changed in "1", "2", ... I just run these tests in a clean Windows 7 in a VM, and the issue is there, so it's not something else on my machine that is interfering. |
I tested it, it happened at 4th clone.
See https://github.com/YueLinHo/msgit_test As @DarkNami mention: |
Finally have this issue to be watched, I have a small group of people using msysgit 1.9.4 that always facing this problem, that's really annoying in daily life. There is nothing problem with the MSE. |
@YueLinHo: Thank you very much for pointing me to the workaround. My main concern is:
So, in my opinion, it's still a regression. |
I suppose that it will be not happened if you commit .gitattributes with the normalization. In the other hand, indeed, it is a issue that committing .gitattributes without the normalization leads to that git does not list all files which should be normalized for each new clone. I guess the root cause is on the timing of refresh index. BTW, the normalization steps I tested and listed in this comment are via TortoiseGit. |
@YueLinHo: Additional info: Normalization does not work as intended Steps to reproduce: Clone my test repo: Try to normalize as you suggested above: Each time you run it, you get a different result. Sometimes files are listed as changed, sometimes they are not. End result is, this is not reliable with msgit. I suggest you remove the "worksforme" tag... This seems to be a reproducible, serious issue with msgit. No way to normalize line ends with msgit, I had to use git on Linux to be sure all files are processed. |
Have you deleted all files first? |
Yep, I just changed the command to: Same result. Sometimes files are listed as changed, sometimes "working directory clean". Just run the above over and over... |
make sure only the .gitattributes is not deleted? |
Yes, @YueLinHo, I verified that manually also. Only .git directory and .gitattributes remain after "rm -Rf *". |
:-/ (using 1.9.2.0) |
I don't quite follow what you're saying... I'm implying that the normalization process itself (e.g. delete all files, do git reset") is flaky and does not always normalize all files. That the clone was doing weird things is just a symptom of this root problem. Can you reproduce this or not? Do you agree normalization does not work as intended? |
Upgrade to 1.9.4.2 and re-test it
I can reproduce the problem that it shows different number of modified for each new clone. I can/will do more test. ^_^
|
@hageltech
The following is another 75 testing result: I feeling it might be some racing condition. (BTW, I don't have the right to remove "WorksForMe" tag. me, a user too.) |
I wrote a little script to do "rm -Rf * && git rm --cached -r . && git reset --hard & git status" repeatedly on Linux, with git 2.0.0, and the results are inconsistent too! It behaves a little different, though... After around 30-40 "good" iterations I get one bad one, where working directory is listed as "clean". So the problem is much less pronounced on Linux, but I must say, at this point, that the issue seems to be with Git in general, and not msysgit specific. Although this is more visible on Windows, the proper course of action is to check whether this still occurs with the latest version of git, and if yes, then to raise this issue at git mailing list. |
agree that |
@t-b , Hello, can you remove WorksForMe for this issue. |
I took this issue to Git mailing list, since it is not restricted to msysgit (although it is more pronounced on msysgit): http://thread.gmane.org/gmane.comp.version-control.git/259202 |
Thanks. Closing here. |
Could you please also change the label from WorksForMe to Upstream? ^_^ Thank you. |
Which is the upstream bug? This is not enough. |
The conclusion These lead to: So, @hageltech reports it to upstream. @lygstate |
But random is strange. |
@linquize |
Please don't close this issue by now, the git community doesn't response yet. |
@lygstate do I understand correctly that you are offering to put in the effort it takes to debug the problem properly? |
@dscho I means the git community doesn't response for this issue, so should we re-ping for this issue? |
@lygstate I think that the only way you can get what you want is to actually invest your own time, effort and/or money into it. If you expect others to do your bidding, you might get lucky, but there is no guarantee. This is my personal opinion, of course. |
@dscho You are totally talking about another thing, I means this issue should be re-open to tracking it. |
@lygstate |
I've done the conversation, bye |
I reset the whole source tree everytime, and even delete the whole folder, and clone the new one
It's always should some file are modified, but the fact, it doesn't,
That's very annoy,
The text was updated successfully, but these errors were encountered: