3

Every once and a while IntelliJ starts getting really slow and the only thing I can do to fix things is to do a fresh checkout and create a new IntelliJ project. Recently I noticed that items I shelved were no longer listed under the Changes tab.

I found all of the .patch files but would like to restore them to the list of changes in the IDE.

I'm fine with an answer along the lines of "before you blow away your old project, copy xxx and yyy from some file and paste that stuff into the new project". Keeping the shelf comments would be a bonus.

Community
  • 1
  • 1
Chris Williams
  • 11,647
  • 15
  • 60
  • 97
  • Doing a fresh checkout and creating a new project is a very drastic operation for a slow IDEA. I would be less willing to help you find a work-around for getting your diffs to follow you and more prone to discovering the underlying problem of your performance. Is there any other details you can give that might provide some insight into your performance issues? Machine specs? Project management tool? etc... – Jesse Webb Sep 08 '10 at 14:45
  • @Gweebz, how would I go about setting up a new laptop for myself? Normally, I'd do a fresh check-out from SVN and then create a new Idea project on top of that. If I did this, I'd lose all of my shelved code. Regardless of what you think my reasons were, can you agree that there are situations where restoring the shelf would be necessary? – Chris Williams Sep 08 '10 at 20:36
  • I understand where you are coming from but I would still recommend against maintaining un-committed changes for that long of a period of time. Version control systems are best used often. This allows simple rollbacks/reverts if a change does not work out properly. I commit as often as possible, period. I would never consider bringing changes over from one machine to another; I would simply start fresh again from the VCS's codebase. Giant commits are usually a bad pattern. – Jesse Webb Sep 08 '10 at 22:37

1 Answers1

4

The VCS I use, SVN, allows for simple creation of patches and also allows patches to be applied to a codebase almost effortlessly. If you already have the .patch files, it should be as simple as using the Version Control -> Apply Patch menu option from within IntelliJ to apply each change-set manually. You should also be able to create a single .patch file from the codebase with your original change-set which will allow you to apply a single patch to bring over your change-set.

Jesse Webb
  • 43,135
  • 27
  • 106
  • 143
  • 1
    I've got the .patch files and I can apply them, no problem. I'd like to be able to migrate all of the .patch files along with the comments I made when I created those shelved items. Without the comments, it's going to be very hard for me to figure out what all of the .patch files are. – Chris Williams Sep 23 '10 at 20:59
  • 1
    The .patch file standard does not save comments inside of the file anywhere. IntelliJ does allow you to enter a comment when you attempt to create a patch but it tries to use this as the patch file's name. For example, using a comment of "My comment" will create a file called "My_comment.patch". If you rename this file, the comment is lost forever. – Jesse Webb Sep 24 '10 at 14:12
  • Accepting because the comment is part of the name of the patch file itself (as @Gweebz indicated, above). That's what I was trying to get to through this post.. I thought the filename that was being used was part of the comment, not the full comment. – Chris Williams Oct 13 '10 at 19:30