This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 192374 - NetBeans deletes file when changing its case!!! *DATA LOSS*
Summary: NetBeans deletes file when changing its case!!! *DATA LOSS*
Status: RESOLVED INVALID
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P1 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-23 21:52 UTC by stiffuser
Modified: 2010-11-24 22:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stiffuser 2010-11-23 21:52:05 UTC
To reproduce:

1. Create a new file as part of a CND project, say Test.h.
2. Keep the file open in the netbeans editor.
3. Open a Terminal and type "mv Test.h test.h". This works fine and changes the case of the filename as expected
4. Go back to NetBeans. Once NetBeans refreshes with the new filename, it *deletes the file*.

I tested this with a Java project and this does not result in data loss - the file is renamed as expected.

I think this is pretty serious - I lost a number of files this way before I had gotten a chance to commit them!
Comment 1 Alexander Simon 2010-11-24 11:36:11 UTC
Do you have case sensitive file system?
Bug does not reproduced on Mac with case nonsensitive file system.
Is bug 100% reproducible?
What is type of you project? (managed or from existing code)
Comment 2 stiffuser 2010-11-24 16:08:35 UTC
I have hfs+ (the default), so the file system is case insensitive. However, it does preserve case, so mv can change the case of a file without technically changing its filename. 

The bug is reproducible every time - I can record a screencast to demo it. The type of project is from existing sources.

Steps in more detail:

1. Right click on a project subfolder, select "New C++ Header File"
2. This creates newfile.h and opens it. I keep it open in the IDE. (I don't think keeping it open matters)
3. Now, I open a Terminal to that dir and type "mv newfile.h Newfile.h"
4. NetBeans detects the rename, closes newfile.h and attempts to open Newfile.h in the editor. However, I just get a gray screen with the text "Loading...", because the file is no longer on the file system.

I'm on the latest Snow Leopard, 10.6.5, and my 6.9.1 IDE is fully up-to-date.

Let me know if you want me to test something.
Comment 3 Vladimir Kvashin 2010-11-24 17:23:32 UTC
I still can not reproduce this (there is a slight difference - I use Mac OS X 10.5.8). File system also case insensitive.

Could you please attach your IDE log (View > Ide Log)?
Comment 4 stiffuser 2010-11-24 17:52:10 UTC
After looking at my IDE log, I realized that the data loss is caused by the nbgit plugin, rather than by NetBeans CND. I disabled the plugin and I can no longer reproduce the issue. I'll file a bug with the NbGit project instead. Sorry :)

INFO [org.nbgit.Git]: Unable to get original file
java.io.FileNotFoundException: projects/backstroke/tests/cfgReverseCodeGenerator/newfile.h
        at org.nbgit.client.CheckoutBuilder.file(CheckoutBuilder.java:140)
        at org.nbgit.util.GitUtils.getFileRevision(GitUtils.java:622)
        at org.nbgit.Git.getOriginalFile(Git.java:226)
        at org.nbgit.GitVCS.getOriginalFile(GitVCS.java:113)
        at org.netbeans.modules.versioning.diff.DiffSidebar.checkoutOriginalFiles(DiffSidebar.java:952)
        at org.netbeans.modules.versioning.diff.DiffSidebar.getText(DiffSidebar.java:878)
        at org.netbeans.modules.versioning.diff.DiffSidebar.access$1200(DiffSidebar.java:102)
        at org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.fetchOriginalContent(DiffSidebar.java:845)
        at org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.computeDiff(DiffSidebar.java:816)
[catch] at org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.run(DiffSidebar.java:801)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)
WARNING [org.netbeans.modules.openide.loaders.DataObjectEncodingQueryImplementation]: Invalid DataObject: /ROSE/projects/backstroke/tests/cfgReverseCodeGenerator/newfile.h
Comment 5 stiffuser 2010-11-24 18:01:28 UTC
It seems that the Git plugin is officially part of NetBeans now (http://netbeans.org/projects/versioncontrol/pages/Git_main) , so I'll simply reassign this to versioncontrol.
Comment 6 Ondrej Vrabec 2010-11-24 22:37:36 UTC
Yes, a git plugin is part of NetBeans now, but it's a different implementation, developed separately by the VCS NetBeans team, it is *not* NBGit (org.nbgit). I suggest you to file an issue on the NBGit project.