I'm working in a large corporate enterprise where all the developer machines are Windows 7 Enterprise SP1.
I'm running major migration project from RTC to git (resulting in something like 1200 git repos). There are no Windows servers in the production environment, build or test environments - everything is either Solaris or RedHat. The solution will be rolled out to ~200 developers.
There is generally a push to use more Unix-command line tools and there are a few different alternatives on Windows such as: Cygwin, git-bash, cmder. I have avoided running a full linux VM because that introduces too many other problems (most developers don't have local admin rights and the internet proxy is a constant hassle so I don't want to make networking a bigger problem with NAT).
I've been running Cygwin (mintty 2.6.2) for the past 8 months and it's been ok until today where I hit a very concerning issue with git (v2.8.3) where git status reported a clean working directory even though multiple files and folders had been deleted in the repo. Only after I recreated a folder with the same name as one of the deleted folders did all the deleted files appear correctly with git status.
I'll explain the symptoms and what I was doing but so far I have not reproduced the issue. My suspicion is that the problem lays somewhere between the emulated linux file system and the actual windows file system. Is there any difference in the way the various emulators achieve this?
The specific problem I hit had these symptoms:
Client side:
- git status showed a clean working directory
- git log showed 3 commits A, B and C (commit C checked out)
- The repo contents was one folder containing a file, 2 more files in the root folder, plus the .git folder with contents
- git stash list was empty
- git branch -a reports only master, HEAD and origin/master
Server side:
- The origin contained 13 additional folders, each with one file
- The origin also contained commits A, B and C
- Only master branch is present
Commit A was the initial empty commit. Commit B was where all contents was added, 14 folders and 16 files. Commit C was another empty commit
Commit A and Commit C were both created using tools to assist with the migration. It runs two commands: "git init" and "git commit --allow-empty -m 'initial commmit'"
I could not understand how git status did not report the deleted files (I remember deleting them, but it was some days previously with multiple computer hibernates, and probably a restart or two from resuming my work)
Trying to figure out what had happened I did this:
- I created a new file then ran "git add", "git commit" (creating D) and "git push."
- Commit D appeared on the server with the new file. The 13 additional folders and files were still present on the server.
- I ran "git pull" which returned "already up to date"
- I checked the changes for every commit on the client side and on the server side and every diff was the same
- I cloned a new copy of the repo and the contents matched the server with the 13 additional files and folders with the additional commit D and extra file
- I then recreated a folder with the same name as one of the deleted folders and ran "git status" where finally all of the deleted files and folders were reported correctly.
I cannot explain this any other way except for a serious bug which simply makes it unsafe to use git in Cygwin. I hope the community may have some advice for me in this area and that this is phrased as a clear enough question that the mods don't flag my post.
I will do my best to try and reproduce the problem and update the issue with more info when I have some.
Edit: Update 2016-12-08
My attempts to reproduce the error have been unsuccessful. If I see it again during my work I will update this issue.