[wp-hackers] Switching from SVN
eric at eam.me
Fri Dec 10 05:02:32 UTC 2010
>When I write code, I sit down and start writing. As I write, I test when
appropriate. When I'm done writing and the code works, I stop. There is no
natural point anywhere in that process for me to check in code. I don't
check in half-written code. I don't write parts of code. I know what I'm
going to code before I ever write the first line.
I do the same thing. But as I've said in previous messages I break up
larger projects into smaller ones. For example:
When adding the new XMLRPC hooks for post formats, I worked on one XMLRPC
method at a time:
1. First I coded for metaWeblog.editPost. Once I finished that, I tested
and made sure it worked. If I were using Hg or Git, I would have committed
2. Next I worked on metaWeblog.newPost (which was very similar). After I
finished I tested and made sure it worked. (I would have committed here).
3. Then I worked on metaWeblog.getPosts and metaWeblog.getRecentPosts at
the same time because they were both small. Tested and made sure they
worked. (I would have committed here).
4. Finally I added the wp.getPostFormats method, tested and got it
working. With everything working for that one ticket, I would have
committed here, then pushed the entire project.
With the SVN system, though, I created a patch of the entire project and
uploaded it to Trac. Yes, this worked, but this is a small example. For
anything significantly larger, it would be much easier to commit in stages,
as the smaller parts of the project are finished, then push when I'm done
with the entire ticket.
On Thu, Dec 9, 2010 at 8:50 PM, Otto <otto at ottodestruct.com> wrote:
> On Thu, Dec 9, 2010 at 10:43 PM, scribu <mail at scribu.net> wrote:
> > Otto, I think the only way you'll get it is by actually trying it out.
> > Maybe start with Mercurial first, since it's command line interface is
> > similar to svn and has a very nice tutorial (already mentioned in this
> > thread):
> > http://hginit.com/
> > Make sure to start at "Subversion Re-education" ;)
> Already read that. Short version: He's wrong and I disagree with the
> very first page of his argument. :)
> Specifically, this:
> "Every time you reach a logical point where your code is a little bit
> better, you can commit it."
> What? WHY?
> Why would you need to check in unfinished code, ever? Put simply, that
> doesn't make a lick of sense. And he doesn't bother to explain it
> either. He does go on to point out the differences between merging a
> set of several changes and merging two big lumps, but again, he never
> bothers to explain why you'd ever check in gradually in the first
> place. Am I supposed to stop every 10 lines and check in the code or
> something? That doesn't make any sense at all.
> When I write code, I sit down and start writing. As I write, I test
> when appropriate. When I'm done writing and the code works, I stop.
> There is no natural point anywhere in that process for me to check in
> code. I don't check in half-written code. I don't write parts of code.
> I know what I'm going to code before I ever write the first line.
> Maybe it's me. Maybe I'm weird. I'll accept that. But I check in when
> I'm done. And I'm done before I stop.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers