GIT pull
My apologies if this isn't the appropriate place to post this. We are using the windows port msysgit so I understand if I need to post over there first.
I have also posted this on stackoverflow. Here is a link to the question there:
My team has had a lot of trouble with GIT lately because of aborted pull commands.
If a user has local modifications not on the index and does a pull, I have seen git attempt to start applying the merge to master and abort. The whole checkout is then left in a terrible state that is nearly unrecoverable. In the past, I thought GIT would run some sort of check to identify these problems before it attempts the merge.
Even with a clean state (nothing to commit), I have seen the same thing randomly happen at least once. I understand that without rebasing, you may be forced to resolve merge conflicts when you pull, but this is not what is happening though.
We are using gitolite. I am mainly using command line and have yet to run into these issues. The rest of the team is using the git-gui or in 1 case TortoiseGit.
git-gui version 0.13.GITGUI
git version 1.7.8.msysgit.0
Tcl/Tk version 8.5.1
TortoiseGit 1.7.6.0
We are not working with branches as much as we could, but feel like this should be working.
Why does GIT allow you to try to pull when it is going to train-wreck? Why does GIT not abort cleanly?
--
View this message in context: http://git.661346.n2.nabble.com/GIT-pull-tp7459655p7459655.html
Sent from the git mailing list archive at Nabble.com.
Looks like it's the virus scan. I had this e-mail that I accidentally sent to Michael directly instead of the list:
I will see if I can build a script that reproduces the issue we are seeing.
We are starting to speculate about what is going on now. Maybe our virus scan is causing some git operation to fail in the middle of the merge.
The "terrible state" is a half-way applied merge.
--
View this message in context: http://git.661346.n2.nabble.com/GIT-pull-tp7459655p7460163.html
Sent from the git mailing list archive at Nabble.com.
Am 12.04.2012 16:47, schrieb cvalusek:
Quoted 11 lines
My team has had a lot of trouble with GIT lately because of aborted pull commands.
If a user has local modifications not on the index and does a pull, I have seen git attempt to start applying the merge to master and abort. The whole checkout is then left in a terrible state that is nearly unrecoverable. In the past, I thought GIT would run some sort of check to identify these problems before it attempts the merge.
Even with a clean state (nothing to commit), I have seen the same thing randomly happen at least once.
As others pointed out, this should not happen. That leaves one
possibility: You are on Windows, and you very likely have one or more of
- a virus scanner
- an IDE
running. It can happen that one of these programs happen to look at a file at the same moment when git is trying to remove or rename the file. This fails because on Windows a file that is open cannot be removed or renamed. In this situation, the merge/checkout is aborted in the middle and leaves a mess behind.
There's not a lot that can be done about it. I thought we have some counter measures in our compatibility layer (e.g., retry the removal if the first attempt fails due to permissions), but I have seen this happen nevertheless. I haven't tried tracking it down because it happens so rarely for me, and it didn't hurt *too* much so far.
-- Hannes
Quoted 4 lines · cvalusek
If a user has local modifications not on the index and does a pull, I have seen git attempt to start applying the merge to master and abort. The whole checkout is then left in a terrible state that is nearly unrecoverable.
What do you mean by "terrible state"? What does "git status" say?
Quoted 2 lines
In the past, I thought GIT would run some sort of check to identify these problems before it attempts the merge.
Git does check uncommited changes before merging. It allows the merge if the changes touch different files (i.e. if the merge is guaranteed not to touch the same files as the one for which you have uncommited changes).
Signature · 2 lines
Matthieu Moy http://www-verimag.imag.fr/~moy/
Quoted 9 lines · Matthieu Moy
Quoted 4 lines · cvalusek
If a user has local modifications not on the index and does a pull, I have seen git attempt to start applying the merge to master and abort. The whole checkout is then left in a terrible state that is nearly unrecoverable.
What do you mean by "terrible state"? What does "git status" say?
Quoted 7 lines
Quoted 2 lines
In the past, I thought GIT would run some sort of check to identify these problems before it attempts the merge.
Git does check uncommited changes before merging. It allows the merge if the changes touch different files (i.e. if the merge is guaranteed not to touch the same files as the one for which you have uncommited changes).
Also, if there *are* conflicts, then you should get an error that looks like the following:
error: Your local changes to the following files would be overwritten by merge:
some-file.txt
Please, commit your changes or stash them before you can merge. Aborting
Sincerely,
Michael Witten