IntelliJ IDEA Change Sets – Cool, but I want more!

I’ve been using the IDEA 6 EAP for a week or so now. In terms of what I use day to day, most of the new features aren’t relevant to me, it’s just a bit smoother in some areas like CSS and JSP editing. Unfortunately I haven’t been able to get the EMMA integration working just yet.

One thing I’ve been paying attention to is the new change sets feature. This is a much nicer way to represent changes across a project, and it basically operates how I used to before: hit the commit all button, check out the list of changes, exclude some files I’m not interested in committing right now, commit the set I was primarily working on. Except now they are named and available from the main IDE (and it is a lot faster).

However, I’ve already been bitten once by something I was more careful with in the previous technique – that is, by making a change in something I’d already moved to a separate change set, without realising it wasn’t going to be committed with everything else.

Given the way IDEA is able to track changes at a level more granular than files, it seems plausible to me that it could track those individual changes. The way I’d see that working is that instead of a “default change set”, there would be a “current editing change set”, where all edits land in. It should be able to switch with a keyboard shortcut to a different current change set (that’s the IntelliJ way). If you made edits in the same file under two or more change sets, IntelliJ could warn you on commit and you could choose to take them all, or just the ones you had in the set (ie, it rolls back the other changes, commits, then puts them back automatically). While that might seem dangerous at first, remember that you were working in a different context at the time so the code should be isolated – it’s especially handy for non-code changes like notes and documentation, and if TeamCity (or another CI server) provides an unbreakable build then the risk is reduced anyway.

From this, there are some natural extensions to the concept – being able to move individual changes between change sets (not just files), and being able to hold on to some change sets for later while taking them out of the current codebase in case its getting in the way of other things.

So, it’s a helpful feature, but I still think it could do more. I generally try to do only one thing at a time anyway (and I’m not sure how much I want to be encouraged to do otherwise!), but it’s certainly nifty when you see something unrelated and are able to take a note or make a quick change without having to write it down to come back to.

I’m not sure if this is something Mylar is able to do in Eclipse, but I’m unlikely to find out because Eclipse drove me running back to IDEA last time I tried it out again. Oh well.

Technorati Tags:

3 responses to “IntelliJ IDEA Change Sets – Cool, but I want more!

  1. Nicolas Breitwieser

    Hi There,

    I bet you didn’t expect a reply, 8 years after you published this article 😉

    I have exactly the same use-case: now (in 2014), IDEA still is not able (or am I missing some hidden features?) to have the same file in two or more changelists at the same time (and separating the individual changes made within each changelist). I really would love this feature, as it saves a lot of time by not having to shelve and unshelve everything whenever you want to work in the same file under a different context (i.e. changelist).


  2. I would love that too and have the same exact problem. A colleague of mine built a git front to our svn server to do exactly that: he uses his local git as a changelist repository and commit little by little while continuing working on his current changelist. Plus side: he doesn’t even use IntelliJ 😀

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s