<< Why's it so tough to sink a basket? | Main | Hardwiring >>
Hooray for standard formats!
chris on 2007-Aug-14 09:57 AM
IDEA 7 has a nifty feature called 'Shelve changes'. Some SCM systems have this -- it's the ability to take a set of changes and have the SCM 'forget' about them so you can do other work independent of them. You can then reintegrate them back in one fell swoop. The typical use case is to move aside changes for a big feature to implement one or more small features at the same time so you don't accidentally bring the 'big feature' changes in with the small ones.
(From what I understand this is built-in to most distributed SCM systems -- branches aren't the heavyweight things they are in Perforce, so every feature becomes its own branch and has its own changesets associated with it. Cool.)
Anyway, somehow IDEA lost track of a shelf I'd made a week or two ago -- I hit Alt-9 to see the changes, then Alt-RightArrow twice to the see the 'Shelf' tab, only to see there was no 'Shelf' tab. Shit! I tried to remember everything I did, and while it wasn't a huge amount it was an hour of work plus testing.
Before I started on that path I went to the directory where IDEA stores all of my stuff: ~/.IntelliJIdea70. Under config/shelf was a single file with the extension of .patch and the name I'd given the shelf. Sure enough, the tried-and-true patch format sat there, and after choosing 'Version Control | Apply patch...' my changes were brought back in. Awesome!
It would have been really easy for the folks at Jetbrains to create their own format for shelved changes, and to tightly couple the 'reintegrate shelf' functionality with the file itself, disallowing its use anywhere else. That they didn't shows, again, how much they know how developers work. The fact that I also could have applied them with the command-line patch tool is also great, and another argument for sticking with standard formats where possible.
[ Tags: scm ide standards ] [ Comments? (2) ] [ Permanent ]
--Jon Postel, RFC 761








Comments
Distributed SCM makes live *so* much easier
I use Darcs, for example, and when I need to hack on an experimental change to The Big Project, I just create a new repo for hacking: "darcs put bigproject-experimental". That's it: a copy of the mainline repo now lives in the bigproject-experimental directory. In that directory, I can hack on experimental changes independently of my mainline work, accumulating changes and making commits into the independent repo. Later, if I decide the overall change is worth keeping, I can merge it into the mainline repo with a single command: "darcs push bigproject-main".
For teams, it gets even better. Each programmer can have his or her own copy of the mainline repo, in addition to creating as many personal branch repos as they want -- for hacking, for working remotely, for the laptop, and so on. Programmers can push and pull changes to and from each other's repos and from the central mainline repo (if there is one -- you don't actually need one). It's pretty slick.
Distributed SCMs are so much better to work with that, if I were forced to used a centralized system, I would actually use Darcs behind the scenes, synchronizing with the centralized system only when convenient.
Of the popular distributed SCMs, Darcs has the most flexible and powerful underlying model, but (for now) Git and Mercurial are probably better for large projects. (Darcs can choke on a couple of corner cases that, history shows, can occur on large team projects.)
Cheers, Tom
Posted by Tom Moertel on August 14, 2007 12:38 PM
I knew you'd chime in
For now, investigation on them is filed in the "Experiment after project release" folder, so hopefully sometime in November...
Posted by Chris on August 14, 2007 3:37 PM
New comments are disabled.