[wp-hackers] Switching from SVN
bulk at thecodecave.com
Fri Dec 10 06:13:50 UTC 2010
On 12/9/2010 11:37 PM, Otto wrote:
> 10 years. SVN was created in 2000.
Actually the 6 years was rough guess at when the WordPress repositories
came into being and were converted into SVN. I remember when I first
started using WordPress I'd grabbed the code using CVS and had even
created my own repository for all the core hacks I did.. Ahhh the good
old days.. That was like WP 1.2 and then it went to SVN not too
terribly long after that. That had to have been 2004-2005ish right?
> See, having a local repository doesn't make any sense. I've never
> needed to roll-back my own changes locally. I just undo the changes
> myself. Or fix the problem. Why would you ever check in non-working
> code? You test the thing *before* you check it in (when possible). I
> don't check in code as I work on it. I work on it until it's working,
> then I check it in.
It all depends upon the paradigm. It seems strange to me too, but I can
definitely see advantages, especially in a corporate environment with
many hands at various skill levels are in the mix. The real issue I see
is that you really don't use the repository iteratively. The WordPress
repository functions almost primarily as a distribution tool, and is
VERY unsuited for mid-development check ins.
Yet, surely you've had time where you've wanted to try an approach you
know may be the way you want to go in the end? Checking in before going
down that path means that you have an easy way to go back to your
original code. Having a local only check in means that it affects no-one
else. With your methodology, you would probably create a local copy
outside of the repository. Two different approaches, but one more
easily allows the commented revisions to stay around longer and perhaps
be revived at a later point.
Another added benefit is that, as you can check in each file in your
batch of changes, you can take the time to comment what was done in
each. Then after the all are in and the code as a whole is in a working
state, you push to the hub. That means there's no unlucky circumstances
where someone does a check out while you only have half of your files in.
> A lot of WordPress treats the checked in code as "production" code.
> It's finished. Ready to run. All of WordPress core is pretty much
> runnable code, except for the occasional mistakes. [..]
> To me, that's the whole point: the checked in code is finished code,
> for the most part. I don't check in unfinished code.
Exactly. And with a local repository the only difference is that you
have an option to safely use the repository iteratively and you'd have
to change your wording to "I don't push unfinished code."
> why you'd want to have to do all this frickin' merging from the
> central back to your local all the bloody time.
LOL That sounds so complicated and painful. The only thing different
for you is that you would do a push with each commit. Heck, you'd
probably even setup an automatic push on the post-commit hook so that
you'd not have to ever even think about the _____ _____ ___ pushes again. :P
> And branching is a
> pain in the ass regardless of what type of system you use, so why
> would you want to do it more?
Because there's pain and then there is
(Pronounced: merging branches via svn). Merging branches may be tedious
if you don't keep up to date with the changes in the trunk, but it
doesn't have to be excruciating.
> In order to make a change, I have to
> download an entire frickin' repo and then create a branch? F- that,
> bro. That's really enough to keep me from even trying. That's why I
> avoid github, because it makes everything complicated. Give me the
> code, let me change it, let me send you the patch. That's easy. That
> way I'm dealing one-on-one with some person. Trying to figure out your
> wacky-ass system is a pain in the ass.
> Just saying. :)
I always like reading your posts :D
Then don't create a branch. That does seem silly! You don't have to
formalize your local check out as a branch. In a practical sense, you
can use git exactly like you use SVN. From my experience, other than
the three letters, the only /required/ difference is a push after the
More information about the wp-hackers