Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334112

Summary: Can't rename projects if they are shared with git
Product: [Technology] EGit Reporter: Roland Hautz <roland>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: acc_eclipse, eclipse.org, matthias.sohn, robert.munteanu, robin.rosenberg
Version: 0.10.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Roland Hautz CLA 2011-01-12 09:45:00 EST
Tried with Egit version is 0.10.1

What steps will reproduce the problem?
1. Rename a project that is shared with git

-- Error Details --
Date: Wed Jan 12 15:30:00 CET 2011
Message: Internal Error
Severity: Error
Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.modeling.product)
Plugin: org.eclipse.ltk.ui.refactoring
Session Data:
eclipse.buildId=M20100909-0800
java.version=1.6.0_23
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.modeling.product
Command-line arguments:  -data /home/roland/ws36cdt -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.modeling.product


Exception Stack Trace:
java.lang.NullPointerException
at org.eclipse.egit.core.GitMoveDeleteHook.moveProject(GitMoveDeleteHook.java:181)
at org.eclipse.team.internal.core.MoveDeleteManager.moveProject(MoveDeleteManager.java:113)
at org.eclipse.core.internal.resources.Resource.unprotectedMove(Resource.java:1980)
at org.eclipse.core.internal.resources.Resource.move(Resource.java:1597)
at org.eclipse.ltk.core.refactoring.resource.RenameResourceChange.perform(RenameResourceChange.java:123)
at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:258)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:306)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:92)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:223)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 1 Robin Rosenberg CLA 2011-03-19 07:53:10 EDT
Patch posted at http://egit.eclipse.org/r/#change,2727
Comment 2 François Rey CLA 2011-03-24 19:02:42 EDT
I'm also experiencing this bug with latest snapshot on 3.6.2 linux 64bit, although I'm getting StringIndexOutOfBoundsException instead of NPE:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at java.lang.String.substring(String.java:1904)
at org.eclipse.egit.core.GitMoveDeleteHook.moveProject(GitMoveDeleteHook.java:185)
at org.eclipse.team.internal.core.MoveDeleteManager.moveProject(MoveDeleteManager.java:113)
at org.eclipse.core.internal.resources.Resource.unprotectedMove(Resource.java:1980)
at org.eclipse.core.internal.resources.Resource.move(Resource.java:1597)
at org.eclipse.ltk.core.refactoring.resource.RenameResourceChange.perform(RenameResourceChange.java:123)
at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:258)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:306)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:92)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:218)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 3 Robin Rosenberg CLA 2011-03-25 05:28:35 EDT
(In reply to comment #2)
> I'm also experiencing this bug with latest snapshot on 3.6.2 linux 64bit,
> although I'm getting StringIndexOutOfBoundsException instead of NPE:
> 
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(String.java:1937)
> at java.lang.String.substring(String.java:1904)

That one is new to me. Can you describe the name of the project, the locstion of it, the location of the related git repos and the location of the workspace?
Comment 4 François Rey CLA 2011-03-25 08:09:53 EDT
Project is under /data/Dev/varin.info/drupal/sites/all/modules/devel
.git folder is in there too
Eclipse project is P/varin.info - drupal - all - modules - devel
Renaming to          varin.info - drupal - all - module - devel
Comment 5 François Rey CLA 2011-03-25 08:10:46 EDT
Workspace is under /home/francois/workspace-3.6/
Comment 6 Robin Rosenberg CLA 2011-04-24 17:31:20 EDT
See also bug 343715 on committing after a rename/move. Besides fixing this
bug, the commit dialog must be fixed too in order to be able to commit the
rename from within JGit.

The proposed patch prepares the index so C Git can be used to commit the rename.
Comment 7 Ryan Sullivan CLA 2011-06-05 23:21:39 EDT
I just got this... I just switched from SVN to GIT and copying and renaming projects is my life blood... this is not good


eclipse.buildId=M20110210-1200
java.version=1.6.0_24
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -clean


Error
Sun Jun 05 23:11:14 EDT 2011
Exception does not provide a detail message

java.lang.NullPointerException
	at org.eclipse.egit.core.GitMoveDeleteHook.moveProject(GitMoveDeleteHook.java:181)
	at org.eclipse.team.internal.core.MoveDeleteManager.moveProject(MoveDeleteManager.java:113)
	at org.eclipse.core.internal.resources.Resource.unprotectedMove(Resource.java:1980)
	at org.eclipse.core.internal.resources.Resource.move(Resource.java:1597)
	at org.eclipse.ltk.core.refactoring.resource.RenameResourceChange.perform(RenameResourceChange.java:123)
	at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
	at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:258)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:306)
	at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:92)
	at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:218)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 8 Robin Rosenberg CLA 2011-06-06 05:12:10 EDT
There is a patch.

Matthias?
Comment 9 Ryan Sullivan CLA 2011-06-06 07:18:51 EDT
Can anyone let me know how to install patch I634d5b44? Thanks.
Comment 10 François Rey CLA 2011-06-06 08:23:22 EDT
Yes the patch should fix it because it's testing for the proper null. Please apply it.
EGit will feel unfinished and unreliable if this bug isn't fixed for 1.0.

Ryan:
Not sure how to apply the patch, maybe this will help: http://wiki.eclipse.org/EGit/Contributor_Guide#Gerrit_Code_Review_Cheatsheet
Otherwise you can try to disconnect the project, move it, then share it again.
Comment 11 Ryan Sullivan CLA 2011-06-09 07:19:58 EDT
I've installed the latest egit version which i assume has this patch: http://download.eclipse.org/egit/staging/v1.0.0.201106081625-r/

The bug still exists. Renaming projects is HUGE for the workflow of copying and renaming projects as a way of starting new ones (which business users do all the time!)

This should be fixed asap. I only wish that I knew more about how to fix this so that I could contribute.
Comment 12 François Rey CLA 2011-06-09 08:01:38 EDT
(In reply to comment #11)
> I've installed the latest egit version which i assume has this patch:
I don't think the patch has been applied, it's still in the review stage:
http://egit.eclipse.org/r/#change,2727
Comment 13 Stefan Lay CLA 2011-11-14 03:54:39 EST
Fixed with 57b79abd8f486af5f95db42435c374404fa40513
Comment 14 Stefan Lay CLA 2011-11-16 10:13:52 EST
*** Bug 360241 has been marked as a duplicate of this bug. ***