| Summary: | Add option to not automatically stage files | ||
|---|---|---|---|
| Product: | [Technology] EGit | Reporter: | Knut Wannheden <knut.wannheden> |
| Component: | Core | Assignee: | Project Inbox <egit.core-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | loskutov, matthias.sohn, oyvind.harboe, twolf |
| Version: | 4.6 | ||
| Target Milestone: | 4.6 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/84522 https://git.eclipse.org/c/egit/egit.git/commit/?id=5f95132e5c3a0422f53c8f886757a8f23ee7a8e6 |
||
| Whiteboard: | |||
|
Description
Knut Wannheden
Took a look at the code that I _think_ is responsible for this. Looks like it should not auto-stage deletions of files for which IResource.isDerived() returns true. Are your generated files marked as derived resources? Probably EGit should check for IResource.isDerived(IResource.CHECK_ANCESTORS), though. Is any parent folder of these generated resources marked as derived? We can add such an option, actually I started working on a patch implementing that. Auto-staging of deletions is implemented in GitMoveDeleteHook.deleteFile(). Why are you versioning files generated by the build ? (In reply to Matthias Sohn from comment #2) > We can add such an option, actually I started working on a patch > implementing that. Cool. In that case, we probably should also start with project-specific properties. This one, and bug 411702. > Auto-staging of deletions is implemented in GitMoveDeleteHook.deleteFile(). Yes, that's what I was looking at. (In reply to Matthias Sohn from comment #2) > We can add such an option, actually I started working on a patch > implementing that. > Auto-staging of deletions is implemented in GitMoveDeleteHook.deleteFile(). Actually the problem is worse: due the auto-staging, if one *renames* the file, the old deleted path will be staged, and new one not, this is quite confusing. I don't know why this was implemented at all. If I delete the file occasionally, it is also staged, if I modify the file, not. Staging should be explicit, triggered by user, not automated. New Gerrit change created: https://git.eclipse.org/r/84522 (In reply to Andrey Loskutov from comment #4) > (In reply to Matthias Sohn from comment #2) > > We can add such an option, actually I started working on a patch > > implementing that. > > Auto-staging of deletions is implemented in GitMoveDeleteHook.deleteFile(). > > Actually the problem is worse: due the auto-staging, if one *renames* the > file, the old deleted path will be staged, and new one not, this is quite > confusing. this works for me (on Mac), moving or renaming a file auto-stages both the new path and the deletion of the old path would you also like to get rid of auto-staging moves ? > I don't know why this was implemented at all. If I delete the file > occasionally, it is also staged, if I modify the file, not. Staging should > be explicit, triggered by user, not automated. do you think we should completely remove auto-staging of file deletions ? (In reply to Matthias Sohn from comment #6) > do you think we should completely remove auto-staging of file deletions ? IMHO it would make sense to add a preference to disable all auto-staging. Without knowing things like what Thomas pointed out in comment #1 the auto-staging behavior may almost appear a but erratic. (In reply to Knut Wannheden from comment #7) > (In reply to Matthias Sohn from comment #6) > > do you think we should completely remove auto-staging of file deletions ? > > IMHO it would make sense to add a preference to disable all auto-staging. > Without knowing things like what Thomas pointed out in comment #1 the > auto-staging behavior may almost appear a but erratic. Yep. I've changed the bug title to make it clear. Gerrit change https://git.eclipse.org/r/84522 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=5f95132e5c3a0422f53c8f886757a8f23ee7a8e6 *** Bug 341322 has been marked as a duplicate of this bug. *** |