Community
Participate
Working Groups
Build Identifier: Version: 3.5.1 As shown in the first screenshot(overwriteFileBug1.png) I overwrite a existing tracked jar with another one. If i then wan't to commit the new jar the commit dialog says that the file has been removed (overwriteFileBug2.png). If I then do a git status with the cli, the cli says that the jar file is removed in the Working-Directory and the jar also shows up as untracked file. If I do a git add "xy.jar" with the cli the next call to git status says that the file has been modified in the working directory. After a refresh in Eclipse Egit also says that the file has been modified... If I replace the jar outside eclipse (Windows-Explorer) (clean git working directory) and do a git status; it tells me that the file has been modified. This is the behavior I would expected... Reproducible: Always
Created attachment 180307 [details] first screen
Created attachment 180308 [details] second screen
This is a result of bug 269067, which has a long history but is unfortunately not fixed. Eclipse sends a delete event when a file is replaced by another one with the same name but not sharing the same local history. I have currently no good idea how to fix it in EGit only. Maybe somebody else has?
(In reply to comment #3) > This is a result of bug 269067, which has a long history but is unfortunately > not fixed. Eclipse sends a delete event when a file is replaced by another one > with the same name but not sharing the same local history. > > I have currently no good idea how to fix it in EGit only. Maybe somebody else > has? Is it posible to check if the file exists in the git working-directory? Eclipse delete Event + file don't exist in working-dir --> file deleted Eclipse delete Event + file exists in working-dir --> file modified I also use subversive. If I overwrite a file in eclipse which is tracked in SVN subversive says that the file has benn modified...
By the way: Even if Egit shows that the file has been removed due to problems with eclipse, Egit must also show the untracked file in the commit dialog, if the checkbox show untracked files is set (second screen). If it doesn't show the untracked file, one has now chance to commit the modified files in Egit. In this case one is forced to use the cli...
(In reply to comment #5) > By the way: > > Even if Egit shows that the file has been removed due to problems with eclipse, > Egit must also show the untracked file in the commit dialog, if the checkbox > show untracked files is set (second screen). If it doesn't show the untracked > file, one has now chance to commit the modified files in Egit. In this case one > is forced to use the cli... Fix proposed for displaying state [removed, untracked] in commit dialog. The content of the file in the working directory is committed. http://egit.eclipse.org/r/#change,1868
correct handling of state [removed, tracked] merged as 27537e107ba4f07a2fbbe3da28b2fa82ba4f63be Do you consider this to be a sufficient fix or do you see more room for improvement here ?
This fix is sufficient to solve this problem