[personal profile] learnedax
Sparked by some comments by [livejournal.com profile] sml, I return to an idea that's been bouncing around in my head: an IDE that truly integrated with source control. It's useful that many modern IDEs help you with checking projects in and out, but mostly they're just taking the place of some other SCM client. There are three ways in which I think an IDE can leverage its specific position to help a tremendous amount with source control, mostly focused on merging - which is the part of SCM that causes most of us the most headaches anyway.

First and most significant, the static analysis tools (up to and including the compiler) an IDE has give it a vastly more informed picture of code changes than any pure-text merge system can hope for. When doing a merge, your IDE could reasonably look at not just the proximity of changes within a file, but the referential impact of the changes. This means it can both declare changes not to be in conflict when they, say, make adjacent changes to different variables, and also declare changes to be in conflict when they break references across multiple files, e.g. I change a method signature and all known invocations, while you add code that invokes that method with the old signature.

What's more, if there is genuine ambiguity about how changes should be merged, the IDE can inform its guesses about the correct result by checking which results are syntactically correct. It can even test build different merges. Of course, since this is relatively Smart behavior making guesses about your code, I think it should fall back ultimately on your judgement - but by doing all this checking upfront, the IDE can at least present much better guesses, and mark them with varying degrees of confidence. For instance, a rollup of merged sections could color code them from green (for changes which appear to be orthogonal to all other known changes) to red (for changes that cannot be satisfactorily merged automatically), with a spectrum in between (e.g. a yellowish marking might show up where two people separately add parameters to a function that appear to be entirely separate changes).

Second, by subscribing to updates on the relevant files/projects (most SCMs provide some sort of at least rudimentary mechanism to allow this), the IDE can speculatively pull in changes in the background, and apply the same intelligent comparisons to give the developer some notice of when they're making changes to pieces of code that someone else is also working on. If it's as good at analyzing code patterns as some programs (Idea) are today, it might even be able tell you when someone else has already added code that looks like the code you're adding, saving you from fixing the same problem. From a UI standpoint, I see the desireable behavior as being intuitive hinting as to the change overlap, rather than anything distracting like alerts - thus perhaps something like using color-coding again to, say, mark the margins from white for untouched code gradually darkening as overlap increases.

Third, and probably most contriversially, the IDE can invisibly create individual branches for each developer. When you save your files, they get committed to your private branch, and when you Commit, they get pushed into the (relative*) trunk. The two advantages to this are that a) you get your work backed up someplace non-local, and b) other instances of the IDE can use your not-yet-complete changes for speculative merges, as above, by looking at automated branches in source control. That means you get an idea of when you're touching the same ground as someone else far in advance of the code being stable for a check-in. Of course, code that's only on a private branch probably gets less weight given to it than anything on the trunk, and especially if it doesn't build on its own. Still, this provides a gradation between completely collaborative work and fully parallel work, where your environment can help you peek at other changes and figure out which ones are relevant to what you're doing.

I can see resistance to each developer being on their own branch, both because it creates longer times between merges and because programmers don't want their partial work recorded in source control. The former I think is a non-issue here, because the entire point of branching would be to aid merging as early and often as possible. The latter is a more serious concern, and I'm not sure it can be easily addressed. Maybe, a la AccuRev**, you control when you check into your private branch and when you commit back to the trunk; that would give everyone a measure of control over what they were showing, while still allowing lookahead before a large batch of changes is totally ready for checkin.


* You might be working on a branch already, which I'm calling your relative trunk.

** AccuRev is bad in most important respects, but giving you two-stage checkins had the glimmer of a good idea in it.

Date: 2009-02-24 04:56 pm (UTC)
From: [identity profile] rickthefightguy.livejournal.com
Wow. I am pretty sure I know what the majority of words in that post mean, but not in that order.

Date: 2009-02-24 05:44 pm (UTC)
From: [identity profile] learnedax.livejournal.com
I tagged it 'programming'... maybe I should have added 'abstruse'.

Date: 2009-02-24 09:24 pm (UTC)
From: [identity profile] rickthefightguy.livejournal.com
Oh, I saw the tag - I was warned. But I never let ignorance get in my way.... :-)

Date: 2009-02-24 11:08 pm (UTC)
From: [identity profile] buddhagrrl.livejournal.com
This post reminds me why I don't want to be a developer anymore. :-p


(One of my all time least favorite programming tasks is not the programming itself but the messy merges and figuring out where good code went bad...)

Date: 2009-02-25 12:37 am (UTC)
From: [identity profile] metahacker.livejournal.com
I'll lend you this book on source control patterns after I finish it...he does a good job of outlining the underlying problems in SCM.

Date: 2009-02-25 12:52 am (UTC)
From: [identity profile] learnedax.livejournal.com
Well, it's probably a fine book, but I am already familiar with most of the problems in SCM... and this is rather tangential to them. This approach should be pretty SCM agnostic, though I think it has the potential to significantly improve the merging situation, so in practical terms it causes fewer people regular pain.

Date: 2009-02-25 01:32 am (UTC)
From: [identity profile] metahacker.livejournal.com
Ironically I am in the middle of writing a semantic-diff routine to allow the sort of integration you envision.

Date: 2009-02-25 01:50 am (UTC)
From: [identity profile] learnedax.livejournal.com
Cool. Do you get to leverage all the semantic analysis work that's out there, or are you stuck re-inventing the wheel?

Date: 2009-02-25 01:36 am (UTC)
From: [identity profile] metahacker.livejournal.com
Also, if you'd read the book, you'd have a richer vocabulary for discussing SCM than, e.g., "two-stage checkins" in AccuRev. I'm just sayin'.

Or, just look at the online cheat-sheet: http://www.scmpatterns.com/book/pattern-summary.html

Date: 2009-02-25 01:48 am (UTC)
From: [identity profile] learnedax.livejournal.com
Don't make the mistake of believing that because you have read that author's glossary, that it is in any sense richer or more correct than mine. I intentionally didn't use the terms that AccuRev uses, for instance, but substituted terms that, in my context, I think capture what I'm talking about.

Date: 2009-02-25 01:52 am (UTC)
From: [identity profile] metahacker.livejournal.com
Wow, is it humanly possible for you to be any more insecure about this?

I know it may be hard to fathom, but I might actually have been trying to help you expand your idea.

Date: 2009-02-25 01:58 am (UTC)
From: [identity profile] learnedax.livejournal.com
Is it humanly possible for you to be any more blind to your snide condescension?

I know it may be hard to fathom, but know I might actually know more about this subject than you.

Date: 2009-02-25 02:03 am (UTC)
From: [identity profile] metahacker.livejournal.com
THIS IS NOT A COMPETITION.

That's not the issue. The question is whether you can learn something useful from the book that might assist you.

Date: 2009-02-25 02:10 am (UTC)
From: [identity profile] learnedax.livejournal.com
No. You have brought up what you describe, at least, as a book on source control patterns, which is all but irrelevant to my post. I have pointed that out, and you have insulted my vocabulary. I've chided you for taking what I see as a narrow view of the subject based on one recent data source, and you have called me insecure.

This conversation no longer has anything to do with the tangentially-related book; it has everything to do with your rudeness.

Date: 2009-02-25 02:35 am (UTC)
From: [identity profile] metahacker.livejournal.com
Have a good night!

Profile

learnedax

November 2011

S M T W T F S
  12345
6789101112
13141516171819
20 212223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 28th, 2025 08:58 am
Powered by Dreamwidth Studios