On Mon, Feb 23, 2009 at 9:56 AM, Andrew P. [email protected]
wrote:
I’d question the wisdom of checking into an integration server every couple
of minutes. I’m not sure if you meant that but if you did then I think these
sort of checkins have to be in bigger chunks.
To me the answer is just what Zach said: commit as often as you want,
every couple of minutes or whatever, but do it in a separate branch.
A branch per actively developed feature isn’t unreasonable. You get
to decide whether that branch is shared remotely or just lives on your
machine. Across a team, if the project is big and structured enough,
you could even have an ‘integration’ branch that you merge into for
CI, then a ‘release’ branch for rolling into production, and leave
‘master’ for point releases or dispense with it entirely. There’s
nothing magic about the ‘master’ branch, it’s just the default name
when others aren’t specified.
If you do end up doing all your work on the master branch, for
whatever reason, it still doesn’t hurt to commit all the time. Just
don’t push it until everything works. Or if you do, don’t push it
to your integration server. Git gives you a lot of control over this
stuff.
Of course if your using Git (or any distributed vcs) you can just branch,
commit locally and rebase from the master. If you want to push to get a
backup as well, you can always have a backup target in addition to your
integration target. If your not using Git (or something similar) locally I’d
highly reccomend that.
To me the single biggest advantage of Git over Subversion and other
prior ilk is the ease of branching. You can branch in Subversion, but
it’s a pain in the ass, requiring some manual repository configuration
and a lot of annoying drudgework on merging. It discourages
developers from doing it casually. In Git, branching is utterly
trivial: creating a branch takes seconds, and merging back is
automatic about 90% of the time. There is no reason not to branch as
often as convenient, and leave the main branch for stuff that’s known
to work.
That’s the win. Offline committing and networks of distributed
repositories are just sort of a bonus for most people. (Particularly
now that Github has helped to reestablish a ‘centralized repository’
culture for the majority of shared Ruby projects.)
–
Have Fun,
Steve E. ([email protected])
ESCAPE POD - The Science Fiction Podcast Magazine
http://www.escapepod.org