Archive for May, 2008

Adjusting My Work Habits to Cope with git

Friday, May 30th, 2008

I had switched to using git after I b0rked one of my projects mercurial repository. It has been problem free so far. But one git oddity bit me in the ass just now. git does not update a remote repository if it is attached to a working directory (non-bare repository in git terms). I found this a bit odd because all of the DVCS that I had used, bzr, darcs, mercurial, they would all update the remote repository if you pushed your changes. git does not do this. I found a thread on the git mailing list and it looks like there had been long debates with regards to this behavior. It also looks like the current behavior will remain unchanged. Worse still, if you do a commit on the remote repo, you will effectively undo that changes made by the last push!

It’s puzzling for someone who came from other DVCS such as darcs and mercurial. I was always under the impression that updating the remote repo when doing a push was the right thing to do.

I found the answer in the git FAQ:

The push operation is always about propagating the repository history and updating the refs, and never touches the working tree files. In particular, if you push to update the branch that is checked out in a remote repository the files in the work tree will not be updated.

This is a precautionary design decision. The remote repository’s work tree may have local changes, and there is no way for you, who are pushing into the remote repository, to resolve conflicts between the changes you are pushing and the ones in the work tree…

Which is absolutely right! I can’t recall how many times I have been hit with this problem. I make changes to the remote repo and commit them. Meanwhile I make changes to the clones, thinking the changes will also benefit the remote repo, I do a push and POOF! conflicts during merge.

I think git’s behavior makes more sense and it’s just a simple matter of remembering to do git reset --hard HEAD on the remote repo to bring the working directory up to date.

MySQL Performance Tuning on Centos 5.1

Saturday, May 17th, 2008

Last week I installed SugarCRM for arsenic.ph to try it out. While I was playing around with adding new users and roles, I noticed that it took over a minute for SugarCRM to finish creating one user. I began investigating and slow queries notwithstanding, MySQL turned out to be the performance bottleneck. This server is still new and I still have not come around to tuning MySQL as I have already begun moving most of my work to Postgres. Unfortunately there are still a large number of good software packages out there that require MySQL so I was left with no choice but to tune it.

(more…)

UML Should Be Used for Documentation not Programming!

Saturday, May 17th, 2008

I just finished reading up on this post from littletutorials.com. Most of these 13 points summarize what I absolutely despise about UML. I had been using UML in one of its early incarnations back in college. I used it once for a small project involving used cars. I used it not because I liked it, but because I was forced to use the damned thing. In college, I used it for my thesis project to “communicate my ideas using a generic, standardized set of symbols”. I used it for the project because my employer needed to see what was going to be done for his site. He already knew SQL and some UML.

I hated it back then, I still hate it now.

(more…)

On the Recent Debian OpenSSL Debacle

Friday, May 16th, 2008

I can think of only two words that best describe the whole deal: Epic fail.

It’s been quite a spectacle ever since I saw that security vulnerability report on the NVD RSS feed. Even though the bug has been patched and fixed, system administrators are now left with the task of cleaning up the mess. It would have been OK if it only affected Debian and Debian-based systems. But it turns out the damage is far reaching. Even if you don’t run Debian, if you are using SSL certificates generated by a CA who generated the certificate using a Debian system, your SSL certificate will have to be revoked and replaced! See here.

Amazing what a couple of lines of code can do.