Community
Participate
Working Groups
1. Select a repo under Git Repositories in EGit 2. Press the Delete key. A dialogue box appears to confirm whether the user wants to remove the repo. 3. Leave 'Also delete repository content in working directory...' UNTICKED. 4. Click OK. Expected behaviour: For the repo to be removed from Eclipse, but nothing to actually be deleted. Actual behaviour: The .git directory is deleted, along with two days' worth of my work in unpushed branches. (I wasn't able to push because of another bug; I was trying to remove the repo from Eclipse and reimport it, to see if that would fix the problem I was having. Now I have a much bigger problem.) Notes: Yes, the dialogue box does include the name of the .git directory in the title. However, elsewhere in Eclipse, e.g. the Project Explorer, when an item is deleted with the 'also delete from disk' checkbox unticked, nothing is actually deleted when it is removed from Eclipse. The fact that it displays the name of the .git directory, and not just the repo, is an easily overlooked detail. Also, since the .git directory normally is *in* the working directory, it's fair for users to assume it would be included in the 'working directory content' they're electing to preserve. Suggested fix: If the intent of this operation really is for the .git directory to be deleted, there should be a second checkbox for this purpose. When it's ticked, the .git directory should actually be deleted, but when it's not, the repo should simply removed from Eclipse. This would make the latter operation possible, and clarify what will happen—a checkbox is less easily overlooked. Additional suggestion: I'm not normally an advocate for 'are you sure' dialogues, but one would be appropriate in this case, because the operation is unusual and potentially catastrophic. It should be worded to ensure users know there's no way to recover unpushed changes on other branches if the .git directory is deleted. I may know this, but it's clear from various forums that a lot of Git users don't.
Also affects EGit 3.0 on Eclipse Kepler, Linux. It is a MAJOR annoyance to have EGit clobbering the .git directory whenever a repository is removed from the view... upvoted.
See also bug 393332 comment 15. The problem summed up: In the context menu, there is both a "Remove Repository from View" and a "Delete Repository...". The former just removes from view, the latter deletes the .git in any case. When pressing the Delete key, the dialog of "Delete Repository..." is shown. As opposed to other Eclipse behavior, just removing it from the view is not possible with the Delete key. Proposed solution: When pressing the Delete key, bring up a dialog with Cancel and two buttons, "Remove Repository from View" and "Delete Repository...". In addition to that, the labels in the "Delete Repository" dialog could be made more clear. Instead of in the description, there could also be an explicit checkbox "Delete repository data in foo/bar/.git". When it's not selected (default), the dialog can not be confirmed. Thoughts on this?
your proposal sounds good to me
(In reply to comment #2) > When pressing the Delete key, bring up a dialog with Cancel and two buttons, > "Remove Repository from View" and "Delete Repository...". Please review: https://git.eclipse.org/r/15252
I can't think of a good reason why someone would expect "delete repository" to remove only the hidden .git folder and preserve the data. To me, this command suggests that the entire directory, data and all, should be deleted. Thoughts? In any case, there seem to be three distinct operations (assuming someone disagrees with me on the above): 1) Remove repo from view 2) Delete .git folder from repo 3) Delete entire repo directory The trouble we're reporting here is that attempting to accomplish #1 may accidentally result in #2. As long as the proposed solution remedies this, sounds good to me.
Created attachment 234203 [details] proposed explicit delete dialog Second change for making the "Delete Repository..." dialog more explicit (see screenshot): https://git.eclipse.org/r/15255
(In reply to comment #5) > I can't think of a good reason why someone would expect "delete repository" > to remove only the hidden .git folder and preserve the data. To me, this > command suggests that the entire directory, data and all, should be deleted. > Thoughts? Well, maybe you found out that you didn't need version control for the project or it was created at the wrong location. See proposed change which should make it more clear what the dialog does. > In any case, there seem to be three distinct operations (assuming someone > disagrees with me on the above): > > 1) Remove repo from view > 2) Delete .git folder from repo > 3) Delete entire repo directory > > The trouble we're reporting here is that attempting to accomplish #1 may > accidentally result in #2. As long as the proposed solution remedies this, > sounds good to me. Yes, this should be fixed by asking whether to do 1 or 2/3 when just pressing the Delete key, see first change.
LGTM
(In reply to comment #4) > (In reply to comment #2) > > When pressing the Delete key, bring up a dialog with Cancel and two buttons, > > "Remove Repository from View" and "Delete Repository...". > > Please review: https://git.eclipse.org/r/15252 merged as 354fa7a5af0dd8d759c7e6516b0e8cf0a73dd513
(In reply to comment #6) > Second change for making the "Delete Repository..." dialog more explicit > (see screenshot): > > https://git.eclipse.org/r/15255 merged as 52218b828cf03abf6df0fc1d99e34cb20a51d2f6
Thanks Matthias (and sorry for being kind of a pain on the review).
cherry-picked for 3.0.2